agent-device

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

agent-device

agent-device

For a normal app-driving task, start immediately. Do not probe first with
--help
,
--version
,
devices
,
appstate
,
snapshot
, or
screenshot
:
bash
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 (
wait text "..."
,
is
,
get
, or
find
), then run
agent-device close
.
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.
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.
对于常规的应用操控任务,请直接开始操作。不要先用
--help
--version
devices
appstate
snapshot
screenshot
命令进行探测:
bash
agent-device open <app> --foreground
该命令会启动会话并返回带有
@refs
的初始交互式快照。
循环流程:使用
press|click|fill|longpress <target> ... --settle
scroll <direction> --settle
back --settle
执行操作;根据打印的差异继续操作,验证预期内容(
wait text "..."
is
get
find
),然后运行
agent-device close
完全按原样复制引用:
@e12
@e12~s4
—— 保留
@
符号和任何
~sN
后缀。优先使用当前引用,其次是
id
/
label
/
role
选择器;坐标是最后的选择。如果快照报告显示sparse/AX-unavailable,则其引用和选择器无效:运行
agent-device screenshot
,检查图片,使用坐标,导航后重试
snapshot -i
。否则,仅当差异中缺少下一个目标时才运行
snapshot -i
错误输出包含纠正提示;请遵循提示操作,而非重新规划。仅当任务具有特殊性(例如手势、脚本、电视、macOS、远程控制或调试)或命令格式不明确时,才运行
agent-device help <topic>
agent-device --help
会列出主题,但这不是启动步骤。