Always use x86 emulators. Although arm emulators exist, they are so slow that they are not worth your time.
You need to target the correct architecture via GN args:
target_cpu = "x86"
By far the easiest way to set up emulator images is to use Android Studio. If you don't have an Android Studio project already, you can create a blank one to be able to reach the Virtual Device Manager screen.
Refer to: https://developer.android.com/studio/run/managing-avds.html
Where files live:
~/.android/avd/
.When creating images:
Known issues:
adb -s emulator-5554 shell mount
(look for /sdcard)~/.android/avd/YOUR_DEVICE/config.ini
.hw.sdCard=no
and set it to yes
Running tests on two emulators is twice as fast as running on one. Rather than use the UI to create additional avds, you can clone an existing one via:
tools/android/emulator/clone_avd.py \ --source-ini ~/.android/avd/EMULATOR_ID.ini \ --dest-ini ~/.android/avd/EMULATOR_ID_CLONED.ini \ --display-name "Cloned Emulator"
Refer to: https://developer.android.com/studio/run/emulator-commandline.html.
Note: Ctrl-C will gracefully close an emulator.
If running under remote desktop:
sudo apt-get install virtualgl vglrun ~/Android/Sdk/tools/emulator @EMULATOR_ID
adb devices