跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 argent-device-interact

Argent Device Interact

与iOS模拟器或iPhone,Android仿真器或手机,或Chrimium(CDP)应用使用argent MCP工具进行交互. 在调用UI元素时使用,执行手势,滚动/擦拭,打字文字,按下硬件按钮,启动应用程序,打开URL,取截图,等待某个元素出现或消失,或在互动后检查可见的应用状态. 不为电视目标.

31218 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

与iOS模拟器或iPhone,Android仿真器或电话,或使用 agent MCP 工具的 Chromium (CDP) 应用交互

何时用

使用 UI 元素, 执行手势, 滚动/ 擦拭, 输入文本, 按下硬件按钮, 启动应用程序, 打开 URL, 抓取截图, 等待元素出现或消失, 或在互动后检查可见的应用状态 。 不是电视目标

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:1. Before You Start、2. Choosing the Right Tool、3. Finding Tap Targets、4. Waiting: `await-ui-element` and `await-screen-idle`、5. Action Sequencing with `run-sequence`、6. Text Entry and Secrets。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/chromium.md、references/harmonyos.md、references/foldables.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Interact with an iOS simulator or iPhone, Android emulator or phone, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions. Not for TV targets.

1. Before You Start2. Choosing the Right Tool3. Finding Tap Targets4. Waiting: `await-ui-element` and `await-screen-idle`5. Action Sequencing with `run-sequence`6. Text Entry and Secrets7. Screenshots8. Android notes

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
argent-device-interact
description
Interact with an iOS simulator or iPhone, Android emulator or phone, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions. Not for TV targets.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 3
  • references/chromium.md
  • references/harmonyos.md
  • references/foldables.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「argent-device-interact」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-35c1fb20c5b1724e-Argent-Device-Interact.html
请存为 .cursor/skills/argent-device-interact/SKILL.md 或 .claude/skills/argent-device-interact/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/software-mansion/argent 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/software-mansion/argent' --list

npx skills add 'https://github.com/software-mansion/argent' --skill 'argent-device-interact'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: argent-device-interact description: Interact with an iOS simulator or iPhone, Android emulator or phone, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions. Not for TV targets. --- Each tool's own description carries its parameters, defaults, return shape and examples. This skill covers choosing between tools and the gotchas those descriptions don't state. ## 1. Before You Start - Get a target id from `list-devices`; if none is ready, `boot-device` one. Full setup flow: `argent-ios-simulator-setup` / `argent-ios-device-setup` / `argent-android-emulator-setup`. The same tool names drive iOS, Android and Chromium; each takes the `udid` from `list-devices`. - Physical iPhone (`kind: "device"`): read `argent-ios-device-interact` first. Only the tools it lists exist there, and `describe` sees only the app `launch-app` registered. - Mac app (`platform: "macos"`): read `argent-macos-app-interact` first. - Read the matching reference before driving these targets: `references/chromium.md` for a `chromium` target, `references/harmonyos.md` for a `harmony` target, `references/foldables.md` for a device `list-devices` marks `foldable: true` (or before calling `fold`). - Load a deferred tool's schema with ToolSearch before its first call (e.g. `gesture-pinch`, `gesture-rotate`, `gesture-custom`); without it, numbers go out as strings and fail validation. - If you delegate device tasks to sub-agents, make sure they have MCP permissions. ## 2. Choosing the Right Tool | Action | Tool | Notes | | ------------------------------ | ------------------- | -------------------------------------------------------------- | | Several known steps | `run-sequence` | One call, one screenshot at the end (§5) | | Open an app | `launch-app` | **Never tap home-screen icons** | | Restart an app | `restart-app` | Clean in-memory state | | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes | | Tap | `gesture-tap` | Buttons, links, checkboxes | | Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium | | Scroll (Chromium) | `gesture-scroll` | Mouse wheel | | Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection | | Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence | | Pinch / zoom | `gesture-pinch` | | | Two-finger rotation | `gesture-rotate` | | | Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton | | Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) | | Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app | | Rotate device | `rotate` | Orientation changes | | Fold device | `fold` | Foldables only: `references/foldables.md` | | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu | | Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text | | Wait for idle | `await-screen-idle` | Block until a non-empty screen tree stops changing (§4) | ## 3. Finding Tap Targets After an action moves you to a different screen, or whenever you don't know an element's coordinates, discover before tapping. Interaction results already carry the element tree (`--- Elements after action (describe) ---`): use it, and call a discovery tool only when no fresh tree covers the current screen. | Need | Tool | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Any screen: app, system dialog, Home screen | `describe` | | UIKit properties of a view (iOS simulator) | `native-find-views` (needs `bundleId` and a class, id, label, tag or `nativeID` to match) | | What sits at a known raw point (iOS simulator) | `native-user-interactable-view-at-point` (the view that receives touch) or `native-view-at-point` (the visually deepest view) | | Final visual fallback | `screenshot`, only when the tools above cannot expose the control. Do not derive routine in-app navigation targets from pixels | If `describe` returns an empty tree, follow its `hint`; with no hint, the screen is blank, loading or unlabeled: check the attached screenshot and retry once content has loaded. For a React Native testID or component name that `describe` does not show, use `debugger-component-tree`; take tap points from `describe`. **React Native:** LogBox toasts sit over the bottom of the screen and catch taps meant for what is under them. Argent hides them when a `debugger-*` tool connects and after `debugger-reload-metro`; after `restart-app`, call a `debugger-*` tool again. After any other reload they come back: close each by tapping the right end of its `describe` frame (the X), not its middle. **System and permission dialogs:** on a simulator or emulator, `describe` returns a visible dialog's buttons with tap coordinates; keep using it for in-app modals too. Fall back to `screenshot` only if it does not expose the controls: then tap one obvious button (`Allow`, `OK`, `Don't Allow`, `Not Now`, `Continue`) at a time, check the returned screenshot, and go back to `describe` once the dialog is gone. > **Prefer the dialog over the Settings tool.** When the app triggers its own permission prompt, answering it is the real user path. Use `settings-permissions` only when you can't make the change through the app: set a permission _before_ the app asks, re-enable one the user denied (iOS won't re-prompt), or reset it so the prompt reappears. See `argent-settings-permissions`. ## 4. Waiting: `await-ui-element` and `await-screen-idle` **Never poll `screenshot`/`describe` in a loop to wait for something.** `await-ui-element` blocks server-side on the same tree `describe` reads. It has no bare-timer mode; for a plain pause, use your own harness sleep. Its description covers conditions, selector matching and defaults. What it does not tell you: - A `hidden` check that succeeds **immediately** may be a false pass: its `note` then says the selector never matched anything. Treat that as a failed check and fix the selector; it does not mean "the element went away". - The synthetic `ROOT` container `describe` prints is never matched, so a `role` like `AXGroup`/`html` won't trivially "match the screen". - To disambiguate a loose selector, pin `role` to a text role like `StaticText`; that skips a same-named button. `await-screen-idle` is for live diagnosis after a launch or navigation, before a raw tap on an element that may still be moving. Continue only when `settled: true`, and pair it with an `await-ui-element` for the destination: stillness does not identify a screen, and the tool can return during a presentation-layer animation. Do not record it in an e2e test; tests use `await: { idle: true }`, which also compares pixels. ## 5. Action Sequencing with `run-sequence` Use `run-sequence` when every step is known in advance; if a step depends on what the previous one shows, use separate calls. Its description lists the allowed tools and their arguments. Typical batches: - "scroll to bottom", "scroll until X": 3-5 swipes - "clear and retype a field": triple-tap to select all, then type the new value - typing then submitting: a `keyboard` text step, then a `keyboard` `enter` step (one call cannot carry both) - "submit form": fill every field, then tap submit - "go back to X": a known tap path Gate a step that depends on a screen transition with an `await-ui-element` step rather than a fixed `delayMs`. If its condition is not met before the timeout, the sequence **stops there** and the later steps do not run, so a tap can't fire against a screen that never appeared. Any failing step also stops the sequence, with partial results. ## 6. Text Entry and Secrets - Tap the field first. Typing or pasting with no focused field is a silent no-op. - `paste` is **not** a faster `keyboard`. `keyboard` types the way a user types and stays the default for every text entry. Use `paste` only where a real user would paste: a 2FA / OTP code from another app, a long link or token, or testing how the app handles pasted input. That it can carry text `keyboard` can't type on a platform (multi-line text, non-ASCII on Android) is not a reason on its own. - **Credentials:** type them as a `{{secret:}}` placeholder in `text` (`keyboard`, `paste`, `run-sequence` keyboard steps, e2e `type` steps), never as plaintext, and never ask the user for the value. Do **not** `describe` or `screenshot` a non-secure field you just filled with a secret: submit or navigate away first, then verify the resulting screen. ## 7. Screenshots Interaction tools already attach a screenshot. Call `screenshot` for the initial state, for a baseline before you change visible UI, to check state after a delay, or when the attached capture shows a transitional or loading frame. Keep the default downscaled capture for UI context and state checks; do not use `scale: 1.0` as a readability or tapping aid. Full resolution is only for saving baseline/current PNGs for comparison (`scale: 1.0` with `includeImageInContext: false`); for visual regression checks use the `argent-screenshot-diff` skill. If `screenshot` times out, restart the device transport with `stop-simulator-server`. ## 8. Android notes - **First-launch permission prompts**: `reinstall-app` on Android installs with `-g`, so runtime permissions are pre-granted on first launch.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…