Skip to content

Android emulator

Android emulator CI on GitHub Actions

Instrumentation tests take 40 minutes because the emulator runs in software.

4m → 25s
Emulator boot
40m → 9m
Test suite

Instrumentation tests take 40 minutes because the emulator runs in software.

Why it happens

Without /dev/kvm the emulator falls back to software rendering, which is roughly ten times slower.

What to change

  1. Run on a runner that exposes KVM to the job
  2. Cache the AVD snapshot so the emulator boots warm
  3. Use a headless system image without Google Play services where possible
  4. Shard instrumentation tests across several emulator instances

Android emulator on runnerhut

yaml
jobs:
instrumentation:
runs-on: runnerhut-8vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- run: ls -l /dev/kvm
- uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
script: ./gradlew connectedDebugAndroidTest
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-8vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.