longpress
Hold a UI element to open a context menu or trigger a press-and-hold gesture. Target by snapshot ref, selector, or coordinates, with adjustable duration.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for command execution. | |
| 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. | |
| stateDir | No | Agent-device state directory. | |
| 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. | |
| daemonBaseUrl | No | Remote daemon base URL. | |
| 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). | |
| daemonAuthToken | No | Remote daemon auth token. | |
| iosXctestEnvDir | No | Writable directory for iOS XCTest runner env overlays. | |
| mcpOutputFormat | No | MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately. | |
| iosXctestrunFile | No | Externally built iOS XCTest runner .xctestrun artifact path. | |
| iosSimulatorDeviceSet | No | iOS simulator device-set path used for device resolution. | |
| androidDeviceAllowlist | No | Android serial allowlist used for device resolution. | |
| iosXctestDerivedDataPath | No | Derived data path for external iOS XCTest runner execution. |
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. |