Skip to main content
Glama

Smoke-test an APK

emu_smoke

Installs 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

NameRequiredDescriptionDefault
apkYesPath to the .apk file on this PC.
avdNoAVD name (default "unity-test", or the EMU_AVD environment variable of the server).
tap_xNoTap position as a fraction of the screen width (default 0.5).
tap_yNoTap position as a fraction of the screen height (default 0.5).
no_tapNoSkip the tap step.
packageNoPackage name (default: read from the APK; a mismatch is an error).
wait_secNoHow 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_markerNoText the app logs when the tap lands (default "SMOKE_TAP count=1").
notif_delayNoSeconds passed to the app as --es notif_delay (default 20); 0 skips the notification check.
no_tap_checkNoTap, but do not wait for tap_marker.
ready_markerNoText the app logs when it is ready (default "SMOKE_APP_READY").
opened_markerNoText the app logs when opened from the notification (default "SMOKE_OPENED_FROM_NOTIFICATION").
ask_permissionNoRevoke POST_NOTIFICATIONS first so the system permission dialog shows again.
no_opened_markerNoThe app logs nothing when opened: opened means its activity is resumed after the tap.
notif_timeout_secNoHow long to wait for the notification (default 240).
ready_timeout_secNoHow long to wait for the ready marker (default 120).
time_travel_minutesNoJump the device clock this many minutes forward after scheduling (long-delay notifications); always reset afterwards.
notif_scheduled_regexNoRegex 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare the safe-write profile (readOnly=false, destructive=false, non-idempotent, closed-world). The description adds substantially more: failure modes (crash, ANR, self-exit fail the run), artifacts written to run_dir, the lease error codes and their meaning, and the job hand-off protocol when the call times out. This is well beyond what the annotations convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the workflow and then the prerequisites, with no filler sentences. It runs slightly dense and merges several ideas into long sentences, but for an 18-parameter multi-step tool nearly every clause carries operational information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description says where artifacts land (summary.json, logcat, screenshots in run_dir), that pass/fail lives in the result, and that a job_id return means the run is still going. For a tool this complex that is complete enough for an agent to call and interpret it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description still adds value by grouping the parameters that matter for a non-sample app (ready_marker, no_tap, tap_marker, notif_delay 0) and by noting that defaults target the bundled sample's log lines, which the per-parameter schema text does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ("Install an APK on the leased emulator and self-test it") and then enumerates the exact sequence of steps performed: ABI check, install, launch, ready marker, tap, background, notification, reopen. It also distinguishes itself from the siblings by naming emu_start (prerequisite), emu_job (continuation) and warning off mobile-mcp.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit prerequisites ("Needs this session's lease (emu_start first)"), explicit branch handling for NO_LEASE and BUSY, explicit guidance when to follow up with emu_job, and an explicit exclusion ("Do not use mobile-mcp while it runs"). It also tells the agent when custom marker settings are needed versus when the defaults apply.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.