The basic pattern
- Name the app exactly as it appears on the device. Verify it is
installed first with
phone_get_state, which lists launchable apps with label and package name. - “Ask me before granting any permissions” turns permission dialogs into
needs_user_controlhandoffs instead of silent grants. - Ask for a structured report - “for each screen: name, what you did, what happened, anything unexpected” - so results drop straight into your bug tracker.
Sizing test runs
Long flows are where timeouts and action limits live. Two levers:- Raise
per_call_timeout_s(default 300 s, max 900) for genuinely long walks. - Split into several tasks in one session - one per flow (onboarding,
settings, checkout). A task that hits
terminal: "iteration_limit"is the signal to break it up further. Splitting also means a crash in one flow doesn’t cost you the report from the previous flows.
Watching the run
- Set
include_steps: trueonphone_task_monitorto pull the task’s recorded steps - screenshots and agent thinking - andsince_stepto fetch only new ones as the run progresses. - Execution is visible on the device screen, so you can literally watch the test happen.
- Use
phone_task_messageto steer mid-run: “skip the newsletter dialog and continue.”
Repeatable runs
For benchmark or regression fleets,phone_run_task accepts optional trace tags - run_id, run_type, and task_metadata - to label runs for later analysis. Leave them unset for normal use.
Keep test devices dedicated where possible: one task runs per device at a
time, and a new MCP task displaces the previous one. Pause a device with
phone_device_pause when its
test data must not be disturbed.Related
Monitoring
Steps, screenshots, and live debugging
Performance
Timeouts and task sizing