argent-vega
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseArgent Vega (Amazon Fire TV)
Argent Vega (Amazon Fire TV)
Critical
重要说明
- Vega is a TV platform
- D-pad only. Drive every interaction with . Never use
tv-remote/ touch — they are unsupported on Vega.gesture-* - Always before navigating. Find the live cursor from the tree — the
describeelement, or[focused]when nothing reports[selected](the toolkit often marks the highlighted item[focused]while[selected]stays false). Never guess focus position from a screenshot.focused - All tools take the Vega (from
serial) aslist-devices.udid
- Vega是一个电视平台
- 仅支持D-pad。所有交互都通过完成。请勿使用
tv-remote/触摸操作——Vega不支持这些方式。gesture-* - 导航前务必调用。从元素树中找到实时光标——
describe元素,如果没有元素标记[focused]则找[focused]元素(工具包通常会将高亮项标记为[selected],而[selected]保持为false)。切勿通过截图猜测焦点位置。focused - 所有工具都将Vega的(来自
serial)作为list-devices参数。udid
The navigation loop
导航循环
Per screen, two calls:
- — find the cursor (
describe, or[focused]if no[selected]) and your target.[focused] - Compute the full D-pad path from focus → target (count rows/columns from the frames) and fire it as one ending in
tv-remote {button:[...]}.select
Then again to confirm. On a miss, run the loop again.
describe每个屏幕操作包含两步调用:
- ——找到光标(
describe元素,若无则找[focused]元素)和目标元素。[selected] - 计算从焦点到目标的完整D-pad路径(根据框架统计行数/列数),并将其作为单次调用发送,最后以
tv-remote {button:[...]结束。select
之后再次调用确认。如果操作失败,重复上述循环。
describeTools
工具
Device lifecycle
设备生命周期
- → Vega devices appear with a
list-devices(use asserial) and audid. Start here to get both.vvdImage - — starts the single SDK-managed VVD (e.g.
boot-device {vvdImage}) and returns itsvvdImage:"tv". Skip ifserialalready shows a running device.list-devices - Stopping the VVD — run in your shell.
vega virtual-device stop
- → Vega设备会显示
list-devices(用作serial)和udid。先调用此工具获取这两个参数。vvdImage - ——启动由SDK管理的单个VVD(例如
boot-device {vvdImage})并返回其vvdImage:"tv"。如果serial已显示运行中的设备,则跳过此步骤。list-devices - 停止VVD ——在终端中运行。
vega virtual-device stop
App lifecycle
应用生命周期
- —
launch-app {udid, bundleId}= interactive component app id from manifest.toml (e.g.bundleId)com.example.app.main - — terminate + launch
restart-app {udid, bundleId} - — uninstall + install;
reinstall-app {udid, bundleId, appPath}= aappPath.vpkg - → on-screen element tree. The discovery tool — call before navigating
describe {udid} - — D-pad; single key, path array, or
tv-remote {udid, button}repeat - or
keyboard {udid, text}— focus the field with the D-pad first{udid, key:"enter"} - — captured host-side via
screenshot {udid, scale?}adb
- ——
launch-app {udid, bundleId}为manifest.toml中的交互式组件应用ID(例如bundleId)com.example.app.main - ——终止并重新启动应用
restart-app {udid, bundleId} - ——卸载并重新安装;
reinstall-app {udid, bundleId, appPath}为appPath文件路径.vpkg - → 获取屏幕元素树。这是发现工具——导航前务必调用
describe {udid} - ——D-pad操作;支持单个按键、路径数组或
tv-remote {udid, button}参数repeat - 或
keyboard {udid, text}——先使用D-pad聚焦输入框{udid, key:"enter"} - ——通过
screenshot {udid, scale?}在主机端捕获截图adb
describe
describedescribe
describeNested element tree from the on-device automation toolkit — each line is a // with its label, (test_id), , and / + a normalized [0,1] frame. is the live D-pad cursor when present; in practice the toolkit usually leaves false and marks the highlighted item , so treat as the cursor whenever no element reports . Navigate on the tree alone. If the tree comes back empty → and retry.
buttontextimageid[clickable][focused][selected][focused]focused[selected][selected][focused]restart-app由设备端自动化工具包生成的嵌套元素树——每一行是一个//元素,包含其标签、(test_id)、属性,以及**/**属性和标准化的[0,1]框架。当存在时,它代表实时D-pad光标;实际使用中,工具包通常会将设为false,而将高亮项标记为,因此当没有元素报告时,将视为光标。仅根据元素树进行导航。如果返回的元素树为空 → 调用并重试。
buttontextimageid[clickable][focused][selected][focused]focused[selected][focused][selected]restart-apptv-remote
tv-remotetv-remote
tv-remotebuttonupdownleftrightselectbackhomemenuplayPauserewindfastForward{button:"down"}{button:"down", repeat:3}{button:["up","right","right","select"]}buttonupdownleftrightselectbackhomemenuplayPauserewindfastForward{button:"down"}{button:"down", repeat:3}{button:["up","right","right","select"]}Fast Refresh
快速刷新
Needs a Debug build + Metro running. argent only connects to Metro — it does not start Metro or port-forward (any platform); do these in your shell.
- Build a Debug and install it:
.vpkgvega device install-app -p <path/to/debug.vpkg> - (Metro on :8081; use
npm start, notnpm start)npx react-native start - (reverse)
vega device start-port-forwarding --port 8081 --forward false vega device launch-app -a <appId>
Metro must be up before launch; confirm lists a target. Then edits hot-reload live.
http://localhost:8081/json/listHermes React Native.tsx需要Debug构建版本 + 运行中的Metro。argent仅连接到Metro——它不会启动Metro或进行端口转发(任何平台);这些操作需要在终端中完成。
- 构建Debug版本的并安装:
.vpkgvega device install-app -p <path/to/debug.vpkg> - 运行(Metro运行在:8081端口;使用
npm start,而非npm start)npx react-native start - 运行(反向端口转发)
vega device start-port-forwarding --port 8081 --forward false - 运行
vega device launch-app -a <appId>
必须在启动应用前启动Metro;确认中列出了目标。之后文件的修改会实时热重载。
http://localhost:8081/json/listHermes React Native.tsxTroubleshooting
故障排查
- returns an empty tree →
describe(the automation toolkit attaches at launch), then retry.restart-app - Keyboard / D-pad input is ignored → enable developer mode inside the VVD: .
vsm developer-mode enable - Editing has no effect → you are on a Release build. Release Vega apps load JavaScript and native code split and stored on device, so patching
node_modulesonly works in Debug builds.node_modules
- 返回空元素树 → 调用
describe(自动化工具包在应用启动时附加),然后重试。restart-app - 键盘/D-pad输入被忽略 → 在VVD内启用开发者模式:。
vsm developer-mode enable - 修改无效果 → 你正在使用Release构建版本。Vega的Release版本应用会拆分加载JavaScript和原生代码并存储在设备上,因此仅在Debug构建版本中修改
node_modules才会生效。node_modules
Platform notes
平台说明
- Metro connects only on port 8081 — fixed, cannot be changed.
- Profiling / crashes → use the server (
amazon-devices-buildertools-mcp,analyze_perfetto_traces,get_app_hot_functions).symbolicate_acr - Unsupported tools, with the Vega equivalent: → use
gesture-*;tv-remote→ not wired;open-url→ JS debugger not supported on Vega. These fail withdebugger-*(orTool '<id>' is not supported on vega vvd.).... is not yet implemented on vega.
- Metro仅连接8081端口——此端口为固定值,无法修改。
- 性能分析/崩溃排查 → 使用服务器(工具包括
amazon-devices-buildertools-mcp、analyze_perfetto_traces、get_app_hot_functions)。symbolicate_acr - 不支持的工具及Vega替代方案:→ 使用
gesture-*;tv-remote→ 未接入;open-url→ Vega不支持JS调试器。使用这些工具会报错debugger-*(或Tool '<id>' is not supported on vega vvd.)。... is not yet implemented on vega.
Knowledgebase
知识库
- Search Vega docs with the tool (
search_documentationserver).amazon-devices-buildertools-mcp - Community Q&A at community.amazondeveloper.com.
- 使用工具(
search_documentation服务器)搜索Vega文档。amazon-devices-buildertools-mcp - 社区问答可访问community.amazondeveloper.com。