Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ Elements are identified by accessibility attributes — not internal refs. Match

¹ `enter` sends HID key 40 (Return); `home` and `lock` use `idb ui button HOME|LOCK`. iOS has no back button, so `back` fails with `UNSUPPORTED_ON_IOS`. `device_type` clears the focused field first with Command+A (`idb ui key 4 --command`) and Backspace (`idb ui key 42`).

On the IDB backend, when the idb client supports `idb ui describe-all --format complete`, `SnapshotResult` also reports `warnings` when the read is incomplete. Today the only warning is `ax-tree-truncated(backend=<name>,depth=<n>,nodes=<n>)`: the idb companion stopped the accessibility read at its size bound, so elements on screen can be missing from `hierarchy`. `backend` is the idb backend that served the read (left out when idb names none), and `depth` and `nodes` are the deepest level and the element count of the tree that came back. `device_snapshot` prints the warnings on a `Warnings:` line. `warnings` is absent when there are none. With such a client, `raw` is the `--format complete` document (`{ backend, truncated, elements, … }`) instead of the tree array.

#### Android snapshot on continuously-redrawing screens

`uiautomator dump` calls `UiAutomation.waitForIdle` internally, which never
Expand Down Expand Up @@ -323,7 +325,8 @@ The `device-mcp` MCP server CLI passes no option, so it uses

On the ADB backend, each `SnapshotResult` also reports `source` (`'dump'` or
`'instrument'`, the path that produced the tree) and `captureMs` (the capture
time, including failed attempts and fallbacks).
time, including failed attempts and fallbacks). For the iOS `warnings` field,
see [Backend Implementation](#backend-implementation).

The helper is a `testOnly` APK installed with `adb install -t`, so it only
installs on developer emulators/attached devices, never on locked-down or
Expand Down
255 changes: 255 additions & 0 deletions src/backends/__fixtures__/idb-describe-all-login-complete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"automation": {
"asserted": false,
"enabled": true
},
"backend": "axbridge-exclusive",
"coverage": null,
"elements": [
{
"type": "Application",
"label": "MetaMask",
"enabled": null,
"frame": {
"x": 0,
"y": 0,
"width": 402,
"height": 874
},
"children": [
{
"type": "Window",
"frame": {
"x": 0,
"y": 0,
"width": 402,
"height": 874
},
"children": [
{
"type": "Other",
"frame": {
"x": 0,
"y": 0,
"width": 402,
"height": 874
},
"children": [
{
"type": "Other",
"identifier": "login",
"frame": {
"x": 0,
"y": 0,
"width": 402,
"height": 874
},
"children": [
{
"type": "Other",
"frame": {
"x": 0,
"y": 120,
"width": 402,
"height": 400
},
"children": [
{
"type": "Image",
"identifier": "fox-logo",
"frame": {
"x": 151,
"y": 140,
"width": 100,
"height": 100
},
"children": []
},
{
"type": "StaticText",
"label": "Welcome back",
"identifier": "login-title",
"frame": {
"x": 24,
"y": 260,
"width": 354,
"height": 36
},
"children": []
},
{
"type": "Other",
"frame": {
"x": 24,
"y": 320,
"width": 354,
"height": 52
},
"children": [
{
"type": "SecureTextField",
"label": "Password",
"identifier": "login-password-input",
"value": null,
"frame": {
"x": 24,
"y": 320,
"width": 354,
"height": 52
},
"children": []
}
]
},
{
"type": "Button",
"label": "Unlock",
"identifier": "log-in-button",
"enabled": false,
"frame": {
"x": 24,
"y": 396,
"width": 354,
"height": 48
},
"children": []
},
{
"type": "Button",
"label": "Forgot password?",
"identifier": "reset-wallet-button",
"frame": {
"x": 24,
"y": 460,
"width": 354,
"height": 32
},
"children": []
}
]
},
{
"type": "Other",
"identifier": "login-info-modal",
"frame": {
"x": 0,
"y": 520,
"width": 402,
"height": 354
},
"children": [
{
"type": "StaticText",
"label": "Unlock with Face ID?",
"frame": {
"x": 24,
"y": 548,
"width": 354,
"height": 24
},
"children": []
},
{
"type": "StaticText",
"label": "You can turn this on later in Settings.",
"frame": {
"x": 24,
"y": 580,
"width": 354,
"height": 40
},
"children": []
},
{
"type": "Other",
"frame": {
"x": 24,
"y": 640,
"width": 354,
"height": 116
},
"children": [
{
"type": "Button",
"label": "Enable",
"identifier": "login-info-modal-enable-button",
"frame": {
"x": 24,
"y": 640,
"width": 354,
"height": 48
},
"children": []
},
{
"type": "Button",
"label": "Not now",
"identifier": "login-info-modal-dismiss-button",
"frame": {
"x": 24,
"y": 704,
"width": 354,
"height": 48
},
"children": []
}
]
}
]
}
]
}
]
}
]
},
{
"type": "Other",
"label": "Status bar",
"frame": {
"x": 0,
"y": 0,
"width": 402,
"height": 54
},
"children": [
{
"type": "StaticText",
"label": "9:41",
"frame": {
"x": 40,
"y": 18,
"width": 40,
"height": 20
},
"children": []
}
]
}
]
}
],
"frames": null,
"interaction": null,
"modal": null,
"narrowing": null,
"profile": null,
"screen": {
"coordinate_space": "screen",
"display": {
"rotation": 0,
"scale": 3
},
"height": 874,
"width": 402
},
"target": {
"kind": "frontmost",
"match_key": null,
"pid": null,
"value": null,
"x": null,
"y": null
},
"truncated": false
}
Loading
Loading