All cheatsheetsAndroid Development

avd manager

AVD Manager 34+

Quick reference for the Android Virtual Device (avdmanager / emulator) CLI: create / edit / delete AVDs, list system images, headless emulator launches, snapshot management, and network forwarding — with common options and practical examples.

34 commands

Inspect

avdmanager list avd

List every AVD with its name, path, target API, ABI, and skin.

-c compact; --force silent

avdmanager list avd
avdmanager list device

List device profiles available for new AVDs (`pixel_6`, `pixel_tablet`, `wear_round`, etc.).

-c

avdmanager list device | head -40
sdkmanager --list

List every SDK package — system images, build tools, platform tools, NDK. Use to find system image ids before creating an AVD.

--include_obsolete

sdkmanager --list | grep 'system-images;android-34'

Install system image

sdkmanager 'system-images;android-<api>;google_apis;x86_64'

Download the Android <api> system image with Google APIs (Play Store / Maps etc.) for x86_64. The image id format is `<type>;<version>;<variant>;<abi>`.

sdkmanager 'system-images;android-34;google_apis_playstore;x86_64'
sdkmanager 'system-images;android-<api>;default;arm64-v8a'

Apple-silicon variant (arm64) — no hardware acceleration required on M-series Macs.

sdkmanager 'system-images;android-33;default;arm64-v8a'

Create AVD

avdmanager create avd -n <name> -k 'system-images;<id>' -d <device>

Create a new AVD interactively-non-interactively. `-n` is the friendly name; `-k` is the system-image package id; `-d` is the device id from `avdmanager list device`.

-f overwrite existing AVD with the same name; -p <path> override default AVD path; --sdcard <size|M|G>

avdmanager create avd -n pixel_7_api34 -k 'system-images;android-34;google_apis_playstore;x86_64' -d pixel_7 --sdcard 512M
echo no | avdmanager create avd ...

Auto-answer the "Create custom hardware profile?" prompt with `no` so the command can run in CI.

echo no | avdmanager create avd -n ci_avd -k 'system-images;android-30;default;x86_64' -d pixel_4
avdmanager create avd -n <name> --tag google_apis_playstore

Tag an AVD for Play Store–flavored system images, useful for testing in-app purchase / Google Sign-In flows.

avdmanager create avd -n pixel_7_playstore -k 'system-images;android-34;google_apis_playstore;x86_64' -d pixel_7 --tag google_apis_playstore

Edit / Delete

avdmanager delete avd -n <name>

Delete an AVD (definition + default snapshots).

-f don't prompt for confirmation

avdmanager delete avd -n old_test_avd -f
avdmanager move avd -n <name> -p <new-path>

Move an AVD to a new directory (handy when migrating `ANDROID_AVD_HOME`).

avdmanager move avd -n pixel_7_api34 -p /mnt/fast-ssd/.android/avd
avdmanager rename avd -n <old> -r <new>

Rename an AVD without re-creating it.

avdmanager rename avd -n pixel_7_api34 -r pixel_7_main

Run emulator

emulator -avd <name>

Boot the named AVD in the current terminal. Requires an emulator package + accelerated virtualisation (KVM/HVF/WHPX).

-no-window; -no-audio; -no-boot-anim; -no-snapshot; -gpu swiftshader_indirect

emulator -avd pixel_7_api34 -no-window -no-snapshot
emulator -avd <name> -no-window -no-snapshot -no-audio -no-boot-anim

CI-friendly headless boot — no display, no sound, skip boot animation, do not load saved snapshot (always cold boot).

-accel auto|off; -gpu host|swiftshader_indirect

emulator -avd ci_avd -no-window -no-snapshot -no-audio -no-boot-anim -gpu swiftshader_indirect -accel auto
emulator -avd <name> -port <port>

Bind the emulator console to a specific port (default 5554 for the first instance; subsequent emulators get 5556, 5558, ...).

-port 5554; -no-snapshot

emulator -avd pixel_7_api34 -port 5554 &
emulator -list-avds

Print every AVD name — useful for scripts that iterate or pick an AVD automatically.

AVD=$(emulator -list-avds | head -1) && emulator -avd "$AVD" -no-window

Snapshots

emulator -avd <name> -no-snapshot

Cold-boot the AVD every time, ignoring any saved snapshot. Use when snapshot state is suspect.

emulator -avd pixel_7_api34 -no-snapshot
adb -s emulator-5554 emu snapshot save <tag>

Save the current emulator state as a named snapshot.

adb -s emulator-5554 emu snapshot save clean-install
adb -s emulator-5554 emu snapshot load <tag>

Restore a named snapshot on next boot.

adb -s emulator-5554 emu snapshot load clean-install

Networking

adb -s emulator-5554 reverse tcp:<d-port> tcp:<h-port>

Make a host port reachable from the emulator (e.g. dev server on `localhost:3000`).

adb -s emulator-5554 reverse tcp:3000 tcp:3000
emulator -avd <name> -dns-server <ip>

Override the DNS server inside the emulator — needed when corporate networks block the Google DNS default.

emulator -avd pixel_7_api34 -dns-server 1.1.1.1

Performance

emulator -avd <name> -memory <MB>

Cap the emulator RAM. Default is derived from the device profile; lower it for CI runners.

emulator -avd pixel_7_api34 -memory 2048
emulator -avd <name> -cores <N>

Set the number of CPU cores reported to the guest.

emulator -avd pixel_7_api34 -cores 4
emulator -avd <name> -gpu <mode>

Choose the graphics backend: `host` uses host GPU (fastest, hardware acceleration), `swiftshader_indirect` is software fallback (CI-safe), `off` disables GPU.

host | swiftshader_indirect | guest | off

emulator -avd pixel_7_api34 -gpu swiftshader_indirect

Hardware

emulator -avd <name> -skin <skin>

Override the AVD's screen skin (`1080x1920`, `480x800`, `Nexus 5`, ...).

emulator -avd pixel_7_api34 -skin 1080x2280
emulator -avd <name> -camera-back <mode>

Set the rear camera source: `emulated` (animated scene), `webcam0`, `webcam1`, `none`.

emulated | webcam<N> | none

emulator -avd pixel_7_api34 -camera-back webcam0

ADB integration

adb -s emulator-<port> install <apk>

Install an APK on a specific emulator by its ADB serial (`emulator-5554`, `emulator-5556`, ...).

adb -s emulator-5554 install -r app-debug.apk
adb -s emulator-<port> shell screencap -p /sdcard/x.png

Capture the emulator screen — useful for screenshot regression tests.

adb -s emulator-5554 shell screencap -p /sdcard/x.png && adb -s emulator-5554 pull /sdcard/x.png ./snap.png
adb -s emulator-<port> emu kill

Gracefully shutdown the named emulator.

adb -s emulator-5554 emu kill

Env variables

echo $ANDROID_AVD_HOME

Print the AVD storage directory (default `~/.android/avd`). Override to move AVDs to a fast SSD.

export ANDROID_AVD_HOME=/mnt/fast-ssd/.android/avd
echo $ANDROID_SDK_ROOT

Print the SDK install root. Both `ANDROID_SDK_ROOT` and `ANDROID_HOME` work; newer scripts prefer the latter.

export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
echo $ANDROID_EMULATOR_HOME

Print the emulator config dir (default `$ANDROID_SDK_ROOT/emulator`). Useful when chasing `~/.android/` vs SDK paths.

ls $ANDROID_EMULATOR_HOME/lib/

Misc

avdmanager --version

Print avdmanager / cmdline-tools version.

avdmanager --version
emulator -version

Print emulator package version.

emulator -version
avdmanager --help

List every avdmanager subcommand with one-line description.

avdmanager --help

Related command cheatsheets

About AVD Manager

The Android Virtual Device (AVD) Manager is the toolchain that powers Android emulators. Two CLIs collaborate: `avdmanager` (ships with Android SDK Command-line Tools, since Studio 3.0 in 2017) for managing AVD definitions, and `emulator` (ships with the Android Emulator package) for running them. An AVD is a profile (hardware, system image, storage, skin) that boots into a QEMU-based virtual Android phone, tablet, Wear, TV, or Auto device. The current stable line is AVD Manager 34+ (Android 14). AVDs are useful for development without a physical device, automated UI tests, demos, and CI matrix coverage. Modern Android Studio prefers x86_64 system images with Google Play (for hardware acceleration + Google APIs). AVDs live under `~/.android/avd/`. Hardware acceleration requires KVM on Linux, HAXM (deprecated) or WHPX/Windows Hypervisor Platform on Windows, and HVF on macOS. Never upload an AVD snapshot — it may contain logged-in Google accounts or proprietary apps.

Cheatsheet version 1.0.0