longpress
Hold any UI element using a snapshot ref, selector, or screen coordinates to open context menus or trigger hold gestures. Customize press duration to match app-specific requirements.
Instructions
Hold a UI target by snapshot ref, selector, or coordinates to open a context menu or perform another hold gesture. Set durationMs when the default hold duration is unsuitable. Times out after 210s; a caller-supplied budget extends it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Use raw snapshot data during selector resolution. | |
| udid | No | iOS device UDID selector. | |
| debug | No | Enable debug diagnostics. | |
| depth | No | Snapshot traversal depth. | |
| runId | No | Lease run identifier. | |
| scope | No | Snapshot scope selector used before resolution. | |
| device | No | Device name selector. | |
| serial | No | Android device or Vega VVD serial selector. | |
| settle | No | After the action, wait for the UI to go quiet and return the settled diff vs the pre-action tree in the same response. Best-effort; never fails the action. | |
| target | Yes | UI target. This is separate from deviceTarget, which selects the device form. | |
| tenant | No | Remote tenant identifier. | |
| leaseId | No | Existing lease identifier. | |
| session | No | Agent-device session name. | |
| noRecord | No | Do not record this action. | |
| platform | No | Platform selector used to resolve a device. | |
| timeoutMs | No | Settle: wait deadline in milliseconds (default 10000). | |
| durationMs | No | Long press duration in milliseconds. | |
| 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. | |
| responseLevel | No | Response verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged. | |
| settleQuietMs | No | Settle: quiet window in milliseconds (default 500). | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Resolved interaction x coordinate when available. | |
| y | No | Resolved interaction y coordinate when available. | |
| ref | No | Snapshot ref without the @ prefix when the target was an @ref. | |
| cost | No | ||
| hint | No | ||
| settle | No | ||
| gesture | No | ||
| message | No | ||
| warning | No | ||
| evidence | No | ||
| refLabel | No | ||
| selector | No | Selector expression when the target was a selector. | |
| durationMs | No | ||
| resolution | No | Pre-action disclosure of how the acting path resolved its target. Absent when resolutionDisclosure is inapplicable for the path. | |
| targetKind | Yes | Resolved interaction target kind. | |
| selectorChain | No | ||
| referenceWidth | No | Reference frame width for visualizing the interaction point. | |
| targetHittable | No | ||
| referenceHeight | No | Reference frame height for visualizing the interaction point. | |
| maestroFallbackReason | No | ||
| maestroNonHittableCoordinateFallbackUsed | No | Whether the direct iOS Maestro coordinate fallback was actually used. | |
| maestroNonHittableCoordinateFallbackAllowed | No | Whether the direct iOS Maestro coordinate fallback was allowed for this selector. |