Skip to content

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. For overlapping labels (e.g. “Property damaged” vs “Property lost”), pass exact=true for strict match or index=N to pick the Nth candidate directly — both short-circuit AMBIGUOUS_MATCH. If AMBIGUOUS_MATCH still occurs, the result includes a candidates[] array with refs you can pass to device_press.

NameTypeRequiredDefaultConstraintsDescription
textstringYesVisible text, accessibility label, or identifier to find
actionstringNoAction to perform: “click” to tap, omit for search-only
exactbooleanNoRequire exact label match (case-sensitive). Skips fuzzy matching entirely.
indexnumberNomin: 0, integerPick the Nth candidate (0-based) when multiple elements match. Short-circuits AMBIGUOUS_MATCH.
device_find(text: <string>)