Android Studio bundles the AVD (Android Virtual Device) Emulator, but if all you need is an emulator — for React Native, Flutter, CI pipelines, or plain APK testing — installing the full IDE is overkill. Google officially supports a command-line-only workflow, and with the release of Android 17 (June 2026) they've shipped a new unified Android CLI (android binary) that makes this even cleaner.
This guide works on macOS (Intel & Apple Silicon) and Linux, and reflects Google's current recommendations:
- The new
androidCLI is now the primary tool —sdkmanageris officially deprecated (android sdkreplaces it). Legacy commands still work, but new setups should use the new CLI. - New package syntax uses
/separators (platforms/android-36) instead of the old;— no more quoting gymnastics in your shell. -
ANDROID_HOMEis the recommended SDK variable;ANDROID_SDK_ROOTis deprecated (this reversed from a few years ago — many old guides get this backwards). - Command line tools must live under
cmdline-tools/latest/— officially documented layout. - JDK 17+ is the baseline. You don't need Oracle JDK — any OpenJDK build works.
- Pick your system image ABI by CPU:
arm64-v8afor Apple Silicon,x86_64for Intel Macs and most Linux machines. A mismatched ABI runs painfully slow or not at all.
1. Install Java (JDK 17 or newer)
The SDK tooling is Java-based. Install any OpenJDK 17+ build:
macOS (Homebrew, recommended):
brew install --cask temurin@21
Ubuntu/Debian:
sudo apt-get install openjdk-21-jdk
Verify:
java -version
Prefer Homebrew/apt over the Oracle installer — easier upgrades, no license prompts, and
JAVA_HOMEtooling (/usr/libexec/java_homeon macOS) picks it up automatically.
2. Download the Command Line Tools
- Go to the Android Studio download page → scroll to "Command line tools only".
- Download the zip for your OS (
commandlinetools-mac-*_latest.ziporcommandlinetools-linux-*_latest.zip). - Create your SDK directory and extract there:
# macOS convention (same location Android Studio would use):
mkdir -p ~/Library/Android/sdk
# Linux convention:
# mkdir -p ~/Android/sdk
unzip commandlinetools-*_latest.zip -d ~/Library/Android/sdk
-
Restructure into
latest/— this exact layout is required by Google's docs, otherwise you'll hit the infamous "Could not determine SDK root" error:
cd ~/Library/Android/sdk/cmdline-tools
mkdir latest
mv bin lib NOTICE.txt source.properties latest/
Final path check — both of these must exist:
~/Library/Android/sdk/cmdline-tools/latest/bin/android # new CLI
~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager # legacy (deprecated)
3. Set Environment Variables
Add to ~/.zshrc (or ~/.bashrc):
######## Android ########
export ANDROID_HOME="$HOME/Library/Android/sdk" # Linux: $HOME/Android/sdk
export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
export PATH="$ANDROID_HOME/platform-tools:$PATH"
export PATH="$ANDROID_HOME/emulator:$PATH"
Do NOT set
ANDROID_SDK_ROOTanymore. It's deprecated, and if both variables are set and ever disagree, Gradle/Android tooling will warn or fail.ANDROID_HOMEalone is correct today.
Reload and verify:
source ~/.zshrc
android --version # new CLI
android info # shows which SDK path is in use
Keep the CLI itself current with:
android update
4. Install Emulator, Platform Tools & a System Image
platform-tools gives you adb; emulator is the emulator engine itself. Note the new / package syntax — no quotes needed:
android sdk install platform-tools emulator
Now install a system image for Android 16 (API 36 — the latest stable-channel SDK level). Pick the ABI matching your CPU:
# Apple Silicon (M-series):
android sdk install system-images/android-36/google_apis_playstore/arm64-v8a platforms/android-36
# Intel Mac / Linux x86_64:
android sdk install system-images/android-36/google_apis_playstore/x86_64 platforms/android-36
Which image variant?
| Variant | Use when |
|---|---|
google_apis_playstore |
You need Play Store apps. adb root is disabled on these images. |
google_apis |
You need Google APIs + root access for debugging. Best for most dev work. |
default (AOSP) |
Lightest, no Google services. |
Explore what's available (supports regex patterns):
android sdk list system-images # filter by pattern
android sdk list --all # everything
android sdk update # update all installed packages
android sdk remove <package-name> # uninstall a package
android-36= Android 16, the latest API level with stable-channel SDK packages as of this writing. Android 17 (API 37) has shipped as an OS, but its SDK platform/system images may still be in pre-release channels — verify withandroid sdk listbefore defaulting to it (see next section).
Testing newer releases (API 37 / 37.1)
Android now ships a major SDK release in Q2 and a minor one in Q4 (API 37 = Android 17; API 37.1 expected ~December 2026 with Android 17 QPR2). Until a level's packages reach the stable channel, they only exist under --beta/--canary — the new CLI makes opting in trivial:
# Check which channel a given API level is actually in:
android sdk list --beta --canary system-images
# Install a pre-release image (drop --beta once it reaches stable):
android sdk install --beta system-images/android-37/google_apis_playstore/arm64-v8a platforms/android-37
# fall back to --canary if it's not in beta yet
Then create a separate AVD against it — keep your stable API 36 device untouched so you always have a known-good baseline:
avdmanager create avd \
--name "Pixel9_API37_preview" \
--package "system-images;android-37;google_apis_playstore;arm64-v8a" \
--device "pixel_9"
Once API 37 packages reach stable, just swap android-36 → android-37 everywhere in this guide.
Legacy equivalents (sdkmanager — deprecated but still functional)
sdkmanager "platform-tools" "emulator"
sdkmanager "system-images;android-36;google_apis_playstore;arm64-v8a" "platforms;android-36"
sdkmanager --licenses
5. Create the AVD
Option A — New CLI (quick, profile-based):
android emulator create --list-profiles # see available device profiles
android emulator create --profile=medium_phone # creates the device
android emulator list # verify
Option B — avdmanager (fine-grained control over device + system image pairing):
Still fully supported, and useful when you need a specific Pixel profile matched to a specific system image:
avdmanager list device
avdmanager create avd \
--name "Pixel9_API36" \
--package "system-images;android-36;google_apis_playstore;arm64-v8a" \
--device "pixel_9"
When asked "Do you wish to create a custom hardware profile?" — say no. Tweak later in ~/.android/avd/<name>.avd/config.ini:
hw.ramSize=4096
hw.keyboard=yes
hw.gpu.enabled=yes
hw.gpu.mode=auto
disk.dataPartition.size=8G
6. Run the Emulator
New CLI:
android emulator start medium_phone # or your AVD name
android emulator stop emulator-5554 # stop by serial number
Known issue:
android emulatorcommands are currently disabled on Windows — Windows users should use the legacyemulatorcommand below.
Legacy launcher (still needed for advanced flags):
emulator -avd Pixel9_API36 -no-snapshot-load
Handy flags for the legacy launcher:
| Flag | What it does |
|---|---|
-no-snapshot-load |
Cold boot (fresh state) instead of resuming a snapshot |
-no-snapshot |
Don't load or save snapshots at all |
-gpu host |
Force host GPU acceleration (default auto is usually fine) |
-netdelay none -netspeed full |
No simulated network throttling |
-wipe-data |
Factory reset the AVD on boot |
-no-window |
Headless mode — perfect for CI |
Verify adb sees the running device:
adb devices
Troubleshooting
Error: Could not load devices from .../devices.xml
You may hit this when creating an AVD:
Error: Could not load devices from <sdk>/system-images/android-36/google_apis_playstore/arm64-v8a/devices.xml
Cause: avdmanager scans every installed system-image directory for an optional devices.xml (extra device definitions), but some cmdline-tools builds treat the missing file as fatal instead of skipping it. Google ships this file in some image zips and not others (the android-36 playstore arm64 r07 image, for example, doesn't include it) — so a perfectly good download still fails.
Fix: drop an empty-but-valid stub into the image directory — avdmanager just needs parseable XML, and device profiles like pixel_9 come from its built-in list anyway:
cat > $ANDROID_HOME/system-images/android-36/google_apis_playstore/arm64-v8a/devices.xml << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<d:devices xmlns:d="http://schemas.android.com/sdk/devices/7"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</d:devices>
EOF
(Adjust the path if your image variant/ABI differs. If you get a schema/namespace error after this, change devices/7 to devices/8 in the stub.)
Then clean up any half-created AVD from the failed attempts and recreate — don't just re-run with --force, as that can carry the broken state forward:
avdmanager delete avd --name "Pixel9_API36" 2>/dev/null
rm -rf ~/.android/avd/Pixel9_API36.avd ~/.android/avd/Pixel9_API36.ini
avdmanager create avd \
--name "Pixel9_API36" \
--package "system-images;android-36;google_apis_playstore;arm64-v8a" \
--device "pixel_9"
Still stuck? Two escape hatches: use the new CLI's own creation path, which doesn't trip on this (android emulator create --profile=medium_phone), or install the google_apis (non-playstore) image variant, which is a different zip and often ships the file.
Error: Could not determine SDK root
Your cmdline-tools aren't in the latest/ sub-directory. Revisit step 2.4 — the binaries must live at cmdline-tools/latest/bin/, not cmdline-tools/bin/.
AVD created but emulator -list-avds shows nothing
Some environments split AVD storage between ~/.android/avd and ~/.config/.android/avd. Check both, and if needed pin the location explicitly by exporting ANDROID_AVD_HOME="$HOME/.android/avd" in your shell profile.
Hardware Acceleration Note
-
Apple Silicon Macs: acceleration works out of the box via the Hypervisor framework — use
arm64-v8aimages. -
Intel Macs: use
x86_64images; Hypervisor.framework is used automatically (HAXM is dead/deprecated). -
Linux: ensure KVM is enabled:
sudo apt install qemu-kvmand add yourself to thekvmgroup (sudo adduser $USER kvm), then re-login.
Without acceleration the emulator is unusably slow, so don't skip this if things feel sluggish.
Bonus: What Else the New CLI Does
The android CLI goes beyond SDK/AVD management — worth knowing even for emulator-only setups:
android run --apks=app-debug.apk # deploy an APK to a device/emulator
android screen capture --output=ui.png # screenshot a connected device
android docs search 'emulator performance' # search official Android docs from terminal
android create --output=./my-app # scaffold a new project from a template
Set persistent defaults in ~/.androidrc (one flag per line), e.g. --sdk=<path> to pin an SDK.
Steps Summary (TL;DR)
- Install JDK 17+ —
brew install --cask temurin@21/apt install openjdk-21-jdk - Download Command line tools only, extract to
~/Library/Android/sdk(Linux:~/Android/sdk) - Restructure: contents of
cmdline-tools/→cmdline-tools/latest/ - In
~/.zshrc, set onlyANDROID_HOME(notANDROID_SDK_ROOT) and addcmdline-tools/latest/bin,platform-tools,emulatortoPATH -
source ~/.zshrc→ verify withandroid --version→android update android sdk install platform-tools emulator-
android sdk install system-images/android-36/google_apis_playstore/arm64-v8a platforms/android-36(usex86_64on Intel/Linux) - Create AVD:
android emulator create --profile=medium_phone— oravdmanager create avd --name "Pixel9_API36" --package "system-images;android-36;google_apis_playstore;arm64-v8a" --device "pixel_9"for full control - Run:
android emulator start medium_phone— oremulator -avd Pixel9_API36 -no-snapshot-load
That's it — a full Android emulator setup in under ~2 GB of downloads instead of the multi-gigabyte Android Studio install, now with Google's modern unified CLI.
Top comments (2)
When finally trying to launch the emulator:
I receive the error:
Little confused because the command line tools are functioning properly.
شارژ کپسول آتشنشانی فرآیندی است که طی آن کپسول خاموشکننده پس از استفاده یا پس از گذشت مدت زمان مشخصی مجدداً پر و آمادهی استفاده میشود. این کار برای اطمینان از عملکرد صحیح و ایمن کپسول در مواقع اضطراری ضروری است.
مراحل شارژ کپسول آتشنشانی:
بررسی اولیه: بررسی ظاهری کپسول برای تشخیص آسیبهای فیزیکی مانند زنگزدگی، ترک، یا نشتی.
تخلیه ماده خاموشکننده: خارج کردن محتوای کپسول برای بررسی و تعویض در صورت نیاز.
بازرسی داخلی: بررسی سیلندر از داخل جهت اطمینان از عدم وجود خوردگی یا آسیب داخلی.
شارژ مجدد با ماده مناسب: پر کردن کپسول با ماده خاموشکننده مطابق با استانداردهای مربوطه (پودر خشک، دیاکسید کربن، فوم و غیره).
بررسی فشار و وزن: اطمینان از میزان صحیح فشار گاز و وزن ماده خاموشکننده.
تعویض قطعات در صورت لزوم: بررسی و تعویض قطعاتی مانند نازل، شلنگ، شیر و سوپاپ در صورت فرسودگی.
پلمپ و برچسبگذاری: درج تاریخ شارژ، نام شرکت تأمینکننده خدمات و مهر تأییدیه ایمنی.
تست نهایی: بررسی عملکرد کپسول با آزمایشهای استاندارد قبل از تحویل.
زمانبندی شارژ کپسول آتشنشانی
شارژ کپسول آتش نشانی سالانه: برای اطمینان از عملکرد صحیح، بررسی و در صورت نیاز شارژ مجدد انجام شود.
پس از استفاده: هر بار که کپسول استفاده شد، حتی به مقدار کم، باید مجدداً شارژ گردد.
طبق توصیه تولیدکننده: برخی کپسولها دورههای شارژ خاصی دارند که باید رعایت شوند.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.