long_press
Perform a long-press on an Android UI element by index, text, or id, or on a screen coordinate (x, y), to trigger context menus or press-and-hold actions.
Instructions
Long-press an element (by index, text or id) or a screen point (x, y).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Screen x (with y), from a screenshot or get_ui | |
| y | No | ||
| id | No | Match resource id / Compose testTag | |
| text | No | Match element text or content description (case-insensitive) | |
| exact | No | Require the whole text/id to match instead of a substring | |
| index | No | Element [ref] from get_ui or a change report | |
| serial | No | adb serial; optional when exactly one device is connected | |
| observe | No | What to return after the action: changes (default: only what changed since you last saw the screen, full tree on a new screen), ui (full tree), screenshot, both (tree + screenshot), none | changes |
| settle_ms | No | Wait before observing | |
| occurrence | No | Which match to use when several match (0-based) | |
| duration_ms | No |