native-find-views
Locate specific UIViews in a running app by class name, accessibility identifier, label, tag, or React Native nativeID—without dumping the full native hierarchy.
Instructions
Search for specific UIViews in the running app by class name, accessibility identifier, accessibility label, tag or React Native nativeID; at least one of these params is required.
Use when you need to locate a specific view by its properties without dumping the entire native-full-hierarchy.
Returns { status: "ok", matches }: the matching views with their frames, properties, optional ancestors and optional children. Frames are in points. frame and center are relative to the superview, and windowFrame turns with the UI. screenFrame is on the axes of the UI as the user sees it, also when the UI is landscape. To tap a view, divide the centre of its screenFrame by the screen size in points, which native-full-hierarchy returns as screen (maxDepth: 1 is enough), and pass the result to gesture-tap. Matches are not filtered for visibility. Before tapping, call native-view-at-point with hitTest: true at that centre, with skipClasses ["UITextEffectsWindow"]. If it does not return the match or a descendant, check a screenshot.
If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help. Restart the tool-server (argent server stop && argent server start --detach) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting. Do not restart it, wait a few seconds and retry. If status is init_failed: follow the message (re-boot the simulator) rather than retrying.
An Apple system app is rejected outright (terminal: never retry it).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"udid": "<udid>",
"bundleId": "<bundleId>"
},
"name": "native-find-views"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | UIView tag integer to match | |
| udid | Yes | Simulator UDID | |
| label | No | Accessibility label to match (exact) | |
| fields | No | View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder | |
| bundleId | Yes | Bundle ID of the app | |
| nativeID | No | React Native nativeID prop to match (exact) | |
| className | No | UIView class name to match (exact, e.g. UIButton) | |
| identifier | No | Accessibility identifier to match (exact) | |
| includeChildren | No | Include child views for each matched view (default true) | |
| includeAncestors | No | Include ancestor chain for each matched view (default true) |