android-testinglisted
Install: claude install-skill earlzdev/android-driver
# Testing an Android app with android-driver
The `android-driver` MCP tools drive an emulator: build, install, tap, assert, snapshot, reset.
## Read the screen with `screen`, not `dump_ui_xml`
`screen` returns one line per actionable element with a `#N` you can tap:
```
#1 [Button] "Sign in" desc=login_button @(540,1320)
#2 [EditText] "" hint="Email" @(540,980)
```
The raw XML behind `dump_ui_xml` is 50–200 KB per screen and will eat the context you need for
the actual work. Reach for it only when you need an attribute `screen` does not surface.
## Prefer a stable selector over coordinates
`tap(desc="login_button")` survives a layout change; `tap_xy(540, 1320)` does not. `list_selectors`
shows the `testTag` / `contentDescription` / `android:id` / string-resource literals the project's own
sources declare — use it instead of guessing a name.
## Snapshot before you explore
Get the app to the state the bug starts from, then `snapshot_save("clean")`. Every later attempt is
`snapshot_load("clean")` — about two seconds, and byte-identical. Reinstalling and re-navigating costs
30–90 seconds and drifts a little each time. This is what makes it practical to test thirty variations
of a hypothesis instead of three, so reach for it early rather than after the third slow reset.
## Assert, don't eyeball
- `expect_visible` / `expect_gone` poll to a deadline, so they are safe right after a tap and will not
flake on an animation.
- `expect_log` polls logcat for a regex. Clear the