dánwòdánwò

Platforms

Parallel emulators

Give each worker its own Android emulator, sized to what this machine can run.

A matrix runs your test many times. On Android each run needs an emulator, so more emulators means a faster matrix, up to what the machine can hold.

Size the workers

androidWorkers picks a worker count from the machine:

danwo.config.ts
import { androidWorkers } from "@danwo/device"
import { defineConfig } from "@danwo/sdk"

export default defineConfig({
  testDir: "tests",
  workers: androidWorkers({ avd: "danwo_spike" }),
})

An emulator takes its AVD's memory plus about a gigabyte, and two cores. androidWorkers allows as many as half the memory and half the cores fit, at most three by default (max). On a machine already busy past its cores, it allows one.

Give each worker its own emulator with worker: workerIndex in withAndroidDevice. Every boot is read-only, so several emulators share one AVD and its snapshots.

How much faster

The example shop's matrix of 29 runs, on a 12-core, 32 GB Apple silicon machine:

EmulatorsWall timeMedian trial
1160 s4.6 s
2103 s5.6 s
395 s7.1 s

Two emulators are the sweet spot there. A third mostly slows each trial down.

Override it

npx @danwo/cli matrix tests/buy-credits.danwo.ts --workers 2

In CI

RunnerNeeds
LinuxKVM (/dev/kvm) and an x86_64 Google APIs image
macOSApple silicon runs arm64-v8a images

Create the AVD with avdmanager, and save a snapshot so each worker boots in seconds.

Next

On this page

Run it on every pull request

A GitHub check and one comment per pull request, with the flight records attached.

Set up CI