open
Boots the selected device if needed and launches an app, deep link, or URL as the session's foreground automation target, with optional Metro server and reload URL hints.
Instructions
Boot the selected device when needed, then open an app, deep link, or URL in a session. Use the app or URL inputs to choose what becomes the foreground automation target. metroHost, metroPort, and bundleUrl choose the app's Metro server and save its address for later reloads. launchUrl selects the app's launch URL and does not select the reload server. A fresh open without Metro hints clears an older same-name binding; close also clears it. Times out after 90s; a caller-supplied budget extends it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | App name, bundle id, package, or URL. | |
| url | No | Optional URL passed with an app shell. | |
| udid | No | Apple device or simulator UDID; the selector that pins one device when several share a name. | |
| debug | No | Enable debug diagnostics. | |
| force | No | Overwrite an existing --save-script target instead of refusing (alias: --overwrite). | |
| runId | No | Lease run identifier. | |
| device | No | Device name selector (a UDID belongs in udid, a serial in serial). | |
| serial | No | Android, HarmonyOS, or Vega VVD serial selector. | |
| target | No | Alias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element. | |
| tenant | No | Remote tenant identifier. | |
| waitMs | No | Block this open for up to n milliseconds (100-120000) while another session holds the device, then fail with DEVICE_IN_USE naming that session. Only session contention is waited for: a device claim held by another workspace is refused at once with its recovery command. A device that never frees, or is taken again while this open waits, costs the full budget, which extends this command's timeout envelope rather than eating into it. | |
| leaseId | No | Existing lease identifier. | |
| session | No | Agent-device session name. | |
| surface | No | macOS presentation surface to open: the app itself, the frontmost app, the desktop, or the menu bar. | |
| testIme | No | Activate the headless Android test IME for deterministic Unicode text entry (default on for emulators; opt-in on real devices). | |
| activity | No | Android activity name. | |
| imageTag | No | Android system image tag for the device a proxy backend leases, for example google_apis_playstore, sent as given. A blank string names nothing; a non-string fails with INVALID_ARGS, reason device-spec-invalid. Only the CLI allocating a lease through connect proxy sends it to that backend; a daemon refuses every other request that names it, with reason device-spec-unsupported. | |
| noRecord | No | Do not record this action. | |
| physical | No | Ask a proxy backend to lease a physical device instead of a simulator or emulator. false names nothing; a non-boolean fails with INVALID_ARGS, reason device-spec-invalid. Only the CLI allocating a lease through connect proxy sends true to that backend; a daemon refuses every other request that names it, with reason device-spec-unsupported. | |
| platform | No | Platform selector used to resolve a device. | |
| relaunch | No | Force relaunch. | |
| bundleUrl | No | Session-scoped bundle URL hint applied to the opened app. | |
| launchUrl | No | Launch URL for the opened app; does not select the server used by metro reload. | |
| metroHost | No | Session-scoped Metro/debug host hint applied to the opened app. | |
| metroPort | No | Session-scoped Metro/debug port hint applied to the opened app. On an emulator/simulator the host defaults to the loopback alias (Android 10.0.2.2, iOS 127.0.0.1) when --metro-host is omitted; physical devices still require an explicit --metro-host. | |
| osVersion | No | OS version or range for the device a proxy backend leases, for example 18.6.2 or ">=26" (Android: API level), sent as given. A blank string names nothing; a non-string fails with INVALID_ARGS, reason device-spec-invalid. Only the CLI allocating a lease through connect proxy sends it to that backend; a daemon refuses every other request that names it, with reason device-spec-unsupported. | |
| timeoutMs | No | Startup budget in milliseconds. Bounds the Simulator boot wait, so a never-booted Simulator can finish its first-boot migration; omit for the default startup behavior. | |
| foreground | No | Include an initial interactive snapshot in a fresh open response. With no app argument, discover the sole running app on the sole booted iOS simulator; ambiguous environments fail closed. | |
| launchArgs | No | Launch arguments forwarded verbatim to the platform launch command. | |
| saveScript | No | ||
| includeCost | No | Include per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged. | |
| deviceTarget | No | Device target form. Maps to the CLI --target flag. | |
| launchConsole | No | File path on the daemon host for the stdout and stderr of the initial app launch. Local iOS simulator direct app launches only; not for URL opens. | |
| responseLevel | No | Response verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged. | |
| mcpOutputFormat | No | MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately. | |
| androidDeviceAllowlist | No | Android serial allowlist used for device resolution. |