Get the UI hierarchy
get_ui_hierarchyDump the current view hierarchy as uiautomator XML with bounds, IDs, text, and clickability to find stable selectors before shell tap/text actions. Use to_file for large dumps.
Instructions
Dump the current view hierarchy of one device as uiautomator XML (uiautomator dump), including bounds, resource ids, text and clickability. Use it to find stable selectors before driving the UI through shell (input tap/text). With to_file: true the XML is kept on the device at /data/local/tmp/adbmcp-ui-.xml and returned as {path, bytes} instead of inline text, so large dumps stay structurally valid; retrieve it with pull_file. Dumps accumulate at that prefix by design — remove them with the shell tool (rm ) after pulling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | Device serial from list_devices; optional when exactly one device is connected. | |
| to_file | No | Write the dump to /data/local/tmp/adbmcp-ui-<timestamp>.xml and return {path, bytes} instead of inline XML (default false). | |
| timeout_ms | No | Timeout in milliseconds for the dump (default 30000). |