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
6 changes: 3 additions & 3 deletions skills/agent-device/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ agent-device open <app> --foreground

That starts the session and returns the initial interactive snapshot with `@refs`.

Loop: act with `press|click|fill|longpress <target> ... --settle`, `scroll <direction> --settle`, or `back --settle`; continue from the printed diff, verify the named expectation with a read-only command (`wait text "..."`, `is`, or `get`; bare `find` clicks, so check with `find text "..." exists`), then run `agent-device close`, or `agent-device close --shutdown` if your session booted a local simulator or emulator, unless the user asks to keep it running.
Loop: act with `press|click|fill|longpress <target> ... --settle`, `scroll <direction> --settle`, or `back --settle`; continue from the printed diff, verify the named expectation with a read-only command (`wait text "..."`, `is`, or `get`; bare `find` clicks, so check with `find text "..." exists`), then run `agent-device close`, or `agent-device close --shutdown` if your session booted a local simulator or emulator, unless the user asks to keep it running. When a result needs time, wait with `wait stable` or `wait absent <selector>` instead of sleeping and reading again.

For exploratory QA, read `agent-device help dogfood`; its platform checks run `agent-device audit`.

For an accessibility review of a whole app, read `agent-device help accessibility`.

Reaching an off-screen target is one command, not a scroll-and-check loop: `scroll down --until <selector>` scrolls until that element is on screen, and `scroll bottom` runs to the end of the content. Repeated bare `scroll down` calls are the slow way to find something.

Copy refs byte-for-byte: `@e12`, `@e12~s4` — keep the `@` and any `~sN`. Prefer current refs, then `id`/`label`/`role` selectors; coordinates are a last resort. If snapshot reports sparse/AX-unavailable, its refs and selectors are invalid: run `agent-device screenshot`, inspect the image, use coordinates, then retry `snapshot -i` after navigating. Otherwise run `snapshot -i` only when the diff lacks the next target.
Copy refs byte-for-byte: `@e12`, `@e12~s4` — keep the `@` and any `~sN`. Prefer current refs, then `id`/`label`/`role` selectors; coordinates are a last resort. If snapshot reports sparse/AX-unavailable, its refs and selectors are invalid: run `agent-device screenshot`, inspect the image, use coordinates, then retry `snapshot -i` after navigating. Otherwise run `snapshot -i` only when the diff lacks the next target. Save a capture to a file you keep: `agent-device screenshot evidence.png` (or pass `--out <path>`).

Error output includes corrective hints; follow them instead of re-planning. Only when the task is specialized (for example gestures, scripting, TV, macOS, remote, or debugging) or a command shape is unclear, run `agent-device help <topic>`. `agent-device --help` lists topics, but is not a startup step.
Error output includes corrective hints; follow them instead of re-planning. If the error is `DEVICE_IN_USE`, another session holds the device: open with `--wait <ms>`, or run `agent-device device status --stale` and then `agent-device device release --stale` to clear a provably dead owner. Never kill daemon processes with `pkill -f agent-device`. Only when the task is specialized (for example gestures, scripting, TV, macOS, remote, or debugging) or a command shape is unclear, run `agent-device help <topic>`. `agent-device --help` lists topics, `agent-device help commands` lists commands; neither is a startup step.

To capture network traffic on a Limrun session, see `agent-device help remote` or the Limrun docs.
21 changes: 21 additions & 0 deletions website/docs/docs/known-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ the device and does not depend on `simctl pbcopy`. A tvOS simulator has no paste
`agent-device` can write from inside the device, so `clipboard write` on tvOS still uses
`simctl pbcopy` and is subject to this problem.

## iOS: system prompts that ask for typed text accept no automated input

iOS shows some prompts outside the app under test: an Apple ID password field, a Screen Time passcode, a device passcode request. `fill` and `type` act inside the app under test, so they cannot enter text into these prompts, and no command enters text there. A prompt that only asks to continue or to cancel is answerable. A prompt that waits for typed text needs a person at the device.

**Workarounds:**

- **Avoid the prompt** with the `settings` channel: `settings permission grant <permission>` pre-grants a permission before the flow, and `settings faceid match` passes a biometric check without the passcode prompt. `settings` on iOS is simulator-only.
- **Answer without typing** with the `alert` channel: `alert accept` and `alert dismiss` press a recognized button, and `alert get` reads the labels of a prompt with unrecognized wording.

## iOS device: `alert` matches English labels only

On an iOS simulator, the runner also recognizes the device's preferred-language wording of the alert labels it knows. A physical iOS device has no such translation step, and tvOS and visionOS devices are the same: `alert accept` and `alert dismiss` match the English labels only. When the device runs in another language, the prompt's buttons carry localized labels, so `alert` answers `ALERT_BUTTON_NOT_FOUND` and taps nothing.

**Workaround:** read the labels with `alert get`, then capture the prompt with `snapshot -i` and `press @ref` on the visible button.

## Android: non-ASCII text on real devices needs `--test-ime`

`adb shell input text` cannot type non-ASCII text (for example Chinese characters or emoji) on any Android system image. `agent-device` installs its own headless test IME (`android-ime-helper`) to type that text. The test IME also keeps the on-screen system keyboard out of snapshots.
Expand Down Expand Up @@ -77,3 +92,9 @@ HarmonyOS HDC exposes no public clipboard interface. `agent-device` can therefor
A copy-then-paste check on HarmonyOS therefore fails silently. The long-press paste flow still runs: the tap on **Paste** lands, and the field receives whatever the device clipboard already holds. Because `agent-device` cannot set that content, the paste can insert text that an earlier manual copy left on the device. The flow reports success, and you see the mismatch only when you read the field back.

**Workaround:** put the text into the field with `fill` or `type`. Both enter text through ArkUI `uitest` and need no clipboard. To verify the app's own copy or paste UX, operate the device by hand, then read the field back with `snapshot`.

## HarmonyOS: Web and custom-drawn content can miss the accessibility tree

`snapshot` on HarmonyOS reads the ArkUI accessibility tree through `uitest`. Content that publishes no accessibility nodes has no entries in that tree: a Web component's page, and custom-drawn surfaces such as a Canvas or a game view. When such content dominates the screen, the capture comes back sparse, and a sparse capture has no usable `@refs`.

**Workaround:** capture the screen with `screenshot`, read the image, and tap by coordinates (`click 120 340`). After a navigation, run `snapshot -i` again before you use refs.
Loading