idb-ui-find-element
Search the accessibility tree by label or identifier to locate UI elements. Obtain tap-ready coordinates (centerX, centerY) to interact with controls directly, eliminating the need for visual screenshots.
Instructions
idb-ui-find-element
Find UI elements by semantic search in accessibility tree - no screenshots needed.
Overview
Queries the accessibility tree and searches for elements matching a label or identifier. Returns matching elements with tap-ready coordinates (centerX, centerY), enabling agents to find specific UI controls without visual analysis. Fast semantic search replaces screenshot-based visual scanning for complex UIs.
Parameters
Required
query (string): Search term to match against element labels or identifiers
Optional
udid (string): Target identifier - auto-detects if omitted
Returns
Array of matching elements with:
Type, label, identifier
Tap-ready coordinates (centerX, centerY)
Full frame boundaries (x, y, width, height)
Returns empty array if no matches found.
Examples
Find login button
const result = await idbUiFindElementTool({
query: 'login'
});Find email field on specific device
const emailField = await idbUiFindElementTool({
query: 'email',
udid: 'DEVICE-UDID'
});Find by identifier partial match
const search = await idbUiFindElementTool({
query: 'submit'
});How It Works
Query accessibility tree: Calls
idb ui describe-all(~80ms)Filter by query: Searches element labels and identifiers (case-insensitive partial match)
Return coordinates: Provides tap-ready centerX/centerY for direct use with idb-ui-tap
Related Tools
accessibility-quality-check: Quick assessment of accessibility data richnessidb-ui-describe: Full accessibility tree with all element detailsidb-ui-tap: Tap elements using coordinatesscreenshot: Visual fallback if accessibility insufficient
Notes
Uses case-insensitive partial matching ("log" matches "Login")
Returns all matching elements (filter in agent logic if needed)
Only returns elements with valid frame coordinates
Much faster than visual analysis (~80ms vs 2000ms for screenshot)
5-6x cheaper token cost (~40 tokens vs ~170 for screenshot)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | ||
| query | Yes |