Skip to content

CICD-472 · Android emulator testing ​

Encyclopedia · Mobile, desktop and binary distribution · All snippets

Previous · CICD-471 · Next · CICD-473

1. Where it fits ​

  • Placement Android CI run step.
  • Prerequisites approved toolchains and isolated build/signing runner when credentials are required.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
adb wait-for-device
timeout 180s adb shell 'while [ "$(getprop sys.boot_completed)" != "1" ]; do sleep 2; done'
./gradlew --no-daemon :app:connectedDebugAndroidTest

3. How it works ​

adb waits for a connected device, then polls its boot-completed property under a deadline. The Gradle instrumentation tests only start after the emulator is ready.

4. Verify the result ​

Start a CI emulator with the pinned API level first and retain instrumentation reports on failure.

Validation syntax-validated (Bash parse). Status definitions.