Advanced options
The following command-line startup options are available, but not commonly used by the average app developer.
In the descriptions, the working directory is the current directory in the terminal where you're entering commands. For information about the AVD system directory and data directory, and the files stored within them, see Understanding the default directories and files.
Some of these options are appropriate for external app developers, and some of them are used primarily by platform developers. App developers create Android apps and run them on specific AVDs. Platform developers work on the Android system and run it inside the emulator with no pre-created AVD; they're internal Android team members, not external app developers.
Advanced Option |
Brief Description |
-bootcharttimeout |
Enable bootcharting, with a timeout in seconds. Some Android system images have a modified init system that integrates a bootcharting facility. You can pass a bootcharting timeout period to the system with this option. If your init system doesn't have bootcharting activated, the option does nothing. This option is primarily useful to platform developers, not external app developers. For example: $ emulator @Nexus_5X_API_23 -bootchart 120 |
-cachefilepath |
Specify a cache partition image file. Provide a filename, and an absolute path or a path relative to the data directory, to set up a persistent cache file. If the file doesn't exist, the emulator creates it as an empty file. If you don't use this option, the default is a temporary file named cache.img. For more information, see AVD data directory. For example: $ emulator @Nexus_5X_API_23 -cache ~/.android/avd/Nexus_5X_API_23.avd/cache_persistent.img |
-cache-sizesize |
Set the cache partition size in MBs. If you don't specify this option, the default is 66 MB. Normally, most app developers don't need this option, unless they need to download very large files that are larger than the default cache. For more information about the cache file, see AVD data directory. For example: $ emulator @Nexus_5X_API_23 -cache-size 1000 |
-datafilepath |
Set the user data partition image file. Provide a filename, and an absolute path or a path relative to the working directory, to set up a persistent user data file. If the file doesn't exist, the emulator creates an image from the default userdata.img file, stores it in the filename you specified, and persists user data to it at shutdown. If you don't use this option, the default is a file named userdata-qemu.img. For more information about the user data file, see AVD data directory. For example: $ emulator @Nexus_5X_API_23 -data ~/.android/avd/Nexus_5X_API_23.avd/userdata-test.img |
-datadir dir |
Specify a data directory using an absolute path. For more information, see AVD data directory. For example: $ emulator @Nexus_5X_API_23 -datadir ~/.android/avd/Nexus_5X_API_23.avd/mytest |
-force-32bit |
Use the 32-bit emulator on 64-bit platforms. Occasionally, this option is useful for testing or debugging. For example, there was an issue where the emulator would sometimes not run on 64-bit Windows, but 32-bit did run; this option was helpful for performing comparisons to debug the issue. Here's an example: $ emulator @Nexus_5X_API_23 -force-32bit |
-help-disk-images |
Get help about about disk images. It provides information relevant to both app and platform developers. For example: $ emulator -help-disk-images |
-help-char-devices |
Get help about character device specifications. A device parameter is required by some emulator options. For example: $ emulator -help-char-devices |
-help-sdk-images |
Get help about disk images relevant to app developers. It explains where the image files are located for an AVD created with the SDK tools. For example: $ emulator -help-sdk-images |
-help-build-images |
Get help about disk images relevant to platform developers. For example: $ emulator -help-build-images |
-initdatafilepath |
Specify the initial version of the data partition. After wiping user data, the emulator copies the contents of the specified file to user data (by default, the userdata-qemu.img file) instead of using the default userdata.imgfile as the initial version. Specify the filename, and an absolute path or a path relative to the working directory. If you don't specify a path, it places the file in the system directory. For more information, see AVD system directory. For example: $ emulator @Nexus_5X_API_23 -initdata ~/Library/Android/sdk/system-images/android-23/google_apis/x86/userdata-test.img |
-kernelfilepath |
Use a specific emulated kernel. If you don't specify a path, the emulator looks in the system directory. If you don't specify this option, the default is kernel-ranchu. For more information, see AVD system directory. Use the‑show‑kernel option to view kernel debug messages. For example: $ emulator @Nexus_5X_API_23 -kernel ~/Library/Android/sdk/system-images/android-23/google_apis/x86/kernel-test.img -show-kernel
|
-noaudio |
Disable audio support for this virtual device. Some Linux and Windows computers have faulty audio drivers that cause different symptoms, such as preventing the emulator from starting. In this case, you can use this option to overcome the issue. Alternatively, you can use the QEMU_AUDIO_DRV environment variable to change the audio backend. For example: $ emulator @Nexus_5X_API_23 -noaudio |
-nocache |
Start the emulator without a cache partition. If you don't use this option, the default is a temporary file named cache.img. This option is for platform developers only. For more information, see AVD data directory. For example: $ emulator @Nexus_5X_API_23 -nocache |
-no-snapshot |
Inhibit both the automatic load and save operations, causing the emulator to execute a full boot sequence and to lose its state when closed. It overrides the -snapshot option. For example: $ emulator @Nexus_5X_API_23 -no-snapshot |
-no-snapshot-load |
Prevent the emulator from loading the AVD state from snapshot storage. Perform a full boot. For example: $ emulator @Nexus_5X_API_23 -no-snapshot-load |
-no-snapshot-save |
Prevent the emulator from saving the AVD state to snapshot storage on exit, meaning that all changes will be lost. For example: $ emulator @Nexus_5X_API_23 -no-snapshot-save |
-no-snapshot-update-time |
Don't try to correct the AVD clock time immediately on snapshot restore. This option can be useful during testing as it avoids a sudden time jump. Time updates are still sent to the AVD about every 15 seconds, however. For example: $ emulator @Nexus_5X_API_23 -no-snapshot-update-time |
-no-snapstorage |
Start the emulator without mounting a file to store or load state snapshots, forcing a full boot and disabling state snapshot functionality. This option overrides the -snapstorage and -snapshot options. For example: $ emulator @Nexus_5X_API_23 -no-snapstorage |
-no-window |
Disable graphical window display on the emulator. This option is useful when running the emulator on servers that have no display. You'll still be able to access the emulator through adb or the console. For example: $ emulator @Nexus_5X_API_23 -no-window |
-partition-size size |
Specify the system data partition size in MBs. For example: $ emulator @Nexus_5X_API_23 -partition-size 1024 |
-propname=value |
Set an Android system property in the emulator when it boots. name must be a property name of at most 32 characters, without any spaces in it, and value must be a string of at most 92 characters. You can specify several ‑prop options on one command line. This option can be useful for debugging. For example: $ emulator @Nexus_5X_API_23 -prop status.battery.level_raw=80 -prop ro.serialno=123456 |
-qemu args |
Pass arguments to the QEMU emulator software. Note that QEMU 1 and QEMU 2 can use different arguments. When using this option, make sure it's the last option specified, as all options after it are interpreted as QEMU-specific options. This option is quite advanced and should be used only by developers who are very familiar with QEMU and Android emulation. |
-qemu -h |
Display -qemu help. For example: $ emulator -qemu -h |
-ramdiskfilepath |
Specify a ramdisk boot image. Specify the filename, and an absolute path or a path relative to the working directory. If you don't use this option, the default is the ramdisk.img file in the system directory. For more information, see AVD system directory. For example: $ emulator @Nexus_5X_API_23 -ramdisk ~/Library/Android/sdk/system-images/android-23/google_apis/x86/ramdisk-test.img |
-report-consolesocket |
Report the console port to a remote third party before starting emulation. It can be useful for an automated testing script. socket must use one of these formats: · tcp:port[,server][,max=seconds][,ipv6] · unix:port[,server][,max=seconds][,ipv6] For more information, use the -help-report-console option as described in Getting detailed help for a specific option. |
-shell |
Create a root shell console on the current terminal. It differs from the adb shell command in the following ways: · It creates a root shell that allows you to modify many parts of the system. · It works even if the adb daemon in the emulated system is broken. · Pressing Ctrl+C (⌘C) stops the emulator, instead of the shell. For example: $ emulator @Nexus_5X_API_23 -shell |
-snapshotname |
Specify the name of a snapshot within a snapshot storage file for automatic start and save operations. Rather than executing a full boot sequence, the emulator can resume execution from an earlier state snapshot, which is usually significantly faster. When you supply this option, the emulator loads the snapshot of that name from the snapshot image and saves it back under the same name on exit. If you don’t use this option, the default is a full boot sequence. If the specified snapshot doesn’t exist, the emulator performs a full boot sequence instead, and performs a save operation. See the -snapstorage option for information on specifying a snapshot storage file and the default file. $ emulator @Nexus_5X_API_23 -snapshot snapshot2 It’s important to remember that in the process of loading a snapshot, all contents of the system, user data, and SD card images are overwritten with the contents they held when the snapshot was made. Unless you save this information in a different snapshot, any changes since then are lost. You can also create a snapshot from the Emulator Console by using the avd snapshot save name command. For more information, see Send Emulator Console Commands to a Virtual Device. |
-snapshot-list |
Display a list of available snapshots. It prints a table of snapshots that are stored in the snapshot storage file that the emulator was started with, then exits. If you specify -snapstorage file as well, this command prints a table of the snapshots stored in file. For example: $ emulator @Nexus_5X_API_23 -snapshot-list -snapstorage ~/.android/avd/Nexus_5X_API_23.avd/snapshots-test.img You can use the ID and TAG column values in the output as arguments for the -snapshot option. |
-snapstoragefilepath |
Specify a repository file that contains all state snapshots. All snapshots made during execution will be saved in this file, and only snapshots in this file can be restored during the emulator run. If you don’t specify this option, the default is snapshots.img in the data directory. If the specified file doesn’t exist, the emulator will start, but without support for saving or loading state snapshots. For example: $ emulator @Nexus_5X_API_23 -snapstorage ~/.android/avd/Nexus_5X_API_23.avd/snapshots-test.img |
-sysdir dir |
Specify a system directory using an absolute path. For more information, see AVD system directory. For example: $ emulator @Nexus_5X_API_23 -sysdir ~/Library/Android/sdk/system-images/android-23/google_apis/x86/test |
-systemfilepath |
Specify an initial system file. Provide the filename, and an absolute path or a path relative to the working directory. If you don't use this option, the default is the system.img file in the system directory. For more information, see AVD system directory. For example: $ emulator @Nexus_5X_API_23 -system ~/Library/Android/sdk/system-images/android-23/google_apis/x86/system-test.img |
-use-system-libs |
On Linux, use the system libstdc++ instead of the version bundled with the emulator system. Use this option only if the emulator won’t start normally, although it doesn’t always work. Alternatively, set theANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1. For example: me-linux$ emulator @Nexus_5X_API_23 -use-system-libs |
-writable-system |
Use this option to have a writable system image during your emulation session. To do so: 1. Start a virtual device with the -writable-system option. 2. Enter the adb remount command from a command terminal to tell the emulator to remount system/ as read/write (it’s mounted as read-only by default). Note that using this flag will create a temporary copy of the system image that can be very large (several hundred MBs), but will be destroyed when the emulator exits. |