run_sequence
Execute a scripted series of Android interaction steps in a single call, bypassing agent round-trips. Conditionally skip steps based on on-screen selectors to handle native timers and biometric prompts, with non-aborting optional steps.
Instructions
Run several interaction steps in ONE call — no agent round-trip between them. Use for scripted flows and, crucially, flows driven by NATIVE TIMERS (background-token clear, a biometric prompt that auto-fires on resume) where a round-trip per step would perturb the timing you're testing: e.g. key:home → sleep:19 → launch → sleep:9 → tap_text:Cancel (if_present:biometric) → assert_foreground(package) → describe_ui. Each step has an 'action' (sleep, tap, tap_text, tap_element, key, text, swipe, launch, stop, assert_foreground, wait_text, describe_ui) with its params; an if_present/if_absent guard skips a step unless a selector is (not) on screen — that's how you express a conditional cancel; and optional=true lets a step fail without aborting. Returns a per-step result (ok/skipped/error) with elapsed_ms plus the final hierarchy. A non-optional step error stops the rest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | Ordered steps to run in one call. Each has an 'action' (sleep, tap, tap_text, tap_element, key, text, swipe, launch, stop, assert_foreground, wait_text, describe_ui) plus that action's params, and optional if_present/if_absent guards and an 'optional' flag. Results include elapsed_ms. | |
| serial | No | Target device serial (adb -s). Optional when exactly one device is attached. | |
| capture_final | No | Append the settled UI hierarchy after the last step (unless the run aborted) so you see the end state in this same response. Default true. |