From 818b712fe192b70925b7ebb63312a22ba75a73cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=A1=82=E9=9B=84?= Date: Sat, 21 Nov 2026 08:51:36 +0800 Subject: [PATCH] docs: document audit-found platform limits and skill routing rules Three real-usage findings were undocumented at the platform-limit level, so agents rediscovered them by failure instead of by doc: - iOS system prompts that ask for typed text (Apple ID password, Screen Time passcode) accept no automated input; the settings and alert channels are the way around, and a prompt that demands typed text needs a person. - iOS physical devices match English alert labels only, unlike simulators that also recognize the device's preferred languages; a device in another language answers ALERT_BUTTON_NOT_FOUND, and the route is alert get plus snapshot and press by ref. - HarmonyOS Web and custom-drawn content can miss the ArkUI accessibility tree, which leaves the capture sparse and its refs unusable; screenshot plus coordinates is the route until a navigation restores the tree. The agent-device skill gains the four routing rules the usage audit showed agents get wrong most often: how to clear DEVICE_IN_USE (device status --stale, device release --stale; never kill daemon processes), where to discover commands (help commands), how to save a screenshot to a file (explicit path or --out), and how to wait (wait stable and wait absent instead of sleep loops). Co-Authored-By: Claude Code --- skills/agent-device/SKILL.md | 6 +++--- website/docs/docs/known-limitations.md | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/skills/agent-device/SKILL.md b/skills/agent-device/SKILL.md index 603796cd69..7b9913c841 100644 --- a/skills/agent-device/SKILL.md +++ b/skills/agent-device/SKILL.md @@ -13,7 +13,7 @@ agent-device open --foreground That starts the session and returns the initial interactive snapshot with `@refs`. -Loop: act with `press|click|fill|longpress ... --settle`, `scroll --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 ... --settle`, `scroll --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 ` instead of sleeping and reading again. For exploratory QA, read `agent-device help dogfood`; its platform checks run `agent-device audit`. @@ -21,8 +21,8 @@ For an accessibility review of a whole app, read `agent-device help accessibilit Reaching an off-screen target is one command, not a scroll-and-check loop: `scroll down --until ` 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 `). -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 `. `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 `, 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 `. `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. diff --git a/website/docs/docs/known-limitations.md b/website/docs/docs/known-limitations.md index 0e38556407..d0d929ef52 100644 --- a/website/docs/docs/known-limitations.md +++ b/website/docs/docs/known-limitations.md @@ -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 ` 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. @@ -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.