Skip to main content

app_source

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

The raw hierarchy, as the device-side server sent it: UiAutomator2's or uiautomator's XML on Android, WebDriverAgent's on iOS, and in a WebView context the page's current markup: the page source. app_map is what to act on — it hands out refs and leaves out what cannot be acted on; this is for when map leaves out the thing you need to see. Password fields have their contents hidden, keeping the length. Geometry is in the platform's units: pixels on Android, but POINTS on iOS, where map, taps and screenshots are in pixels — multiply by the answer's scale. Never tap coordinates read from it.

Read-only: readOnlyHint is true.

Arguments​

NameTypeRequiredWhat it is
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Save the raw hierarchy​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_source",
"arguments": {}
}
}