device_find
Find a UI element by visible text and optionally interact with it. Use action=“click” to tap, omit for find-only. Returns element ref for use with device_press/device_fill. Requires an open session (call device_snapshot action=open first). If AMBIGUOUS_MATCH error occurs (common text like “Next”, “Done”), use device_snapshot to get the accessibility tree and device_press with the specific @ref instead.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
text | string | Yes | Visible text, accessibility label, or identifier to find | ||
action | string | No | Action to perform: “click” to tap, omit for search-only |
device_find(text: <string>)