| name | android-test-emulator |
|---|---|
| description | Launch or create the local Android emulator required before running Android connected/instrumented tests in this repository. Use this whenever running Android tests is required and no suitable device is already connected. |
Use this skill before running Android connected tests such as connectedAndroidTest or connectedDebugAndroidTest.
The required AVD name is Unstyled_Tests. If it does not exist, create it with:
- API level:
23 - System image:
system-images;android-23;default;x86_64, except Apple Silicon Macs usesystem-images;android-23;default;arm64-v8a - Display:
320x640 - Density:
160 dpi - CPU cores:
2 - Disk size:
2048M
-
Check connected devices:
adb devices
-
If a device is already connected and booted, use it.
-
Create the project emulator if it does not exist:
bash scripts/createAndroidEmulator
-
Launch the project emulator:
bash scripts/launchAndroidEmulator
-
Wait until boot is complete before running Android tests. The script waits for:
adb shell getprop sys.boot_completed
-
After the emulator is ready, run the requested Android test task.
- Do not run Android tests until the emulator appears in
adb devicesasdeviceandsys.boot_completedis1. - If
emulatoris not onPATH, use$ANDROID_HOME/emulator/emulator,$ANDROID_SDK_ROOT/emulator/emulator, or$HOME/Library/Android/sdk/emulator/emulator. - The script uses the same runtime options expected for test execution:
-no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none.