Smoke-test an APK
emu_smokeInstalls an APK on a leased Android emulator and runs an outside-app smoke test: ABI check, launch, logcat ready check, tap, notification, and reopen verification.
Instructions
Install an APK on the leased emulator and self-test it from outside the app: ABI check, install, launch, wait for the ready marker in logcat (crash, ANR or self-exit fail the run), tap, background, local notification in the shade, tap it and check the app opens. Results (summary.json, logcat, screenshots) go to run_dir; check pass in the result. Needs this session's lease (emu_start first): NO_LEASE means take it, BUSY means another session uses the emulator (wait or ask the person). Defaults are the bundled sample app's log lines; for another app set ready_marker, no_tap or tap_marker, and notif_delay 0. Runs as a job: if the result is a job_id, call emu_job with it and do not start another smoke meanwhile. Do not use mobile-mcp while it runs.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"apk": "<apk>"
},
"name": "emu_smoke"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apk | Yes | Path to the .apk file on this PC. | |
| avd | No | AVD name (default "unity-test", or the EMU_AVD environment variable of the server). | |
| tap_x | No | Tap position as a fraction of the screen width (default 0.5). | |
| tap_y | No | Tap position as a fraction of the screen height (default 0.5). | |
| no_tap | No | Skip the tap step. | |
| package | No | Package name (default: read from the APK; a mismatch is an error). | |
| wait_sec | No | How long this call waits for the job (default 50, max 600). If the job is still running, the call returns a job_id for emu_job. | |
| tap_marker | No | Text the app logs when the tap lands (default "SMOKE_TAP count=1"). | |
| notif_delay | No | Seconds passed to the app as --es notif_delay (default 20); 0 skips the notification check. | |
| no_tap_check | No | Tap, but do not wait for tap_marker. | |
| ready_marker | No | Text the app logs when it is ready (default "SMOKE_APP_READY"). | |
| opened_marker | No | Text the app logs when opened from the notification (default "SMOKE_OPENED_FROM_NOTIFICATION"). | |
| ask_permission | No | Revoke POST_NOTIFICATIONS first so the system permission dialog shows again. | |
| no_opened_marker | No | The app logs nothing when opened: opened means its activity is resumed after the tap. | |
| notif_timeout_sec | No | How long to wait for the notification (default 240). | |
| ready_timeout_sec | No | How long to wait for the ready marker (default 120). | |
| time_travel_minutes | No | Jump the device clock this many minutes forward after scheduling (long-delay notifications); always reset afterwards. | |
| notif_scheduled_regex | No | Regex over logcat whose capture group 1 is the notification title (default "SMOKE_NOTIF_SCHEDULED id=\d+ title=(\S+)"). JavaScript regex syntax; a leading (?i), (?m) or (?s) is allowed, and groups are numbered as in .NET (unnamed groups first), so PowerShell -NotifScheduledRegex values pick the same title. |