Setting up an Android emulator
This document will guide you through the setup of a smoothly running emulator. Some tweaks are needed which are not very well documented.
Come up with a name for the AVD and determine which package and ABI to
use. The package can be determined checking the installed
system-images;* packages using
sdkmanager --list --verbose.
The ABI can be determined as a path from
$ANDROID_HOME/system-images/$PACKAGE/$IMAGE
An example AVD van be created using the following command:
avdmanager create avd \ --name Nougat \ --package 'system-images;android-25;google_apis;x86' \ --abi google_apis/x86When asked to create a custom hardware profile, answer yes.
When asked for the options hw.audioInput and hw.audioOutput, set
them to no. This will greatly reduce memory usage.
For the option hw.gpu.enabled, set it to yes. This will make the
emulator run much smoother.
It is possible to tweak these settings later in
~/.android/avd/<name>.avd/config.ini.
The emulator can now be stared using:
emulator -use-system-libs -avd <name>