mcpField
A
another-android

another-android

github.com/zfinixAgent 工作流83336 次安装3 周前更新
代码仓库

关于 another-android

another-android 是一项通过 Another 桌面应用控制 Android 设备的技能,适用于需要检查屏幕并自动执行设备操作的场景。它涵盖触控、应用启动、Shell 命令和 WiFi 调试。

主要功能

  1. 01查看连接的 Android 设备
  2. 02截图检查设备屏幕
  3. 03触控、滑动和输入文字
  4. 04启动应用并打开 URL
  5. 05运行 adb Shell 命令
  6. 06切换及连接 WiFi 调试

适用场景

  1. 01检查应用界面并执行操作
  2. 02在 Android 应用中输入和导航
  3. 03通过 Shell 查询设备信息
  4. 04将 USB 设备切换为 WiFi 调试

MCP 相关

该技能通过 Another 桌面应用启用的 MCP 服务连接 Android 设备。需在 MCP 设置中配置服务地址,并按列出设备、连接、截图、操作和断开的顺序使用。

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/zfinix/another --skill another-android

安装后在 Claude Code 中输入/another-android确认已加载。

详细介绍

Another - Android 设备控制

你可以通过 Another MCP 服务访问 Android 设备。使用这些工具查看屏幕内容、与设备交互并自动执行任务。

设置

Another 桌面应用必须正在运行,并启用 MCP Server(默认在 Settings 中启用)。

将以下内容添加到你的 MCP 设置中(Claude Code、Claude Desktop、Cursor 等):

{
  "mcpServers": {
    "another": {
      "type": "http",
      "url": "http://localhost:7070/mcp"
    }
  }
}

工作流

始终按以下顺序操作:

  1. 列出设备,查看有哪些可用设备
  2. 连接设备,建立控制会话
  3. 截屏,查看当前屏幕状态
  4. 使用触摸、文本、按钮、滑动等方式操作
  5. 再次截屏,验证结果
  6. 完成后断开连接

可用工具

设备管理
工具功能
another_list_devices列出所有已连接的 Android 设备
another_connect_device连接到设备(启动 scrcpy 控制会话)
another_disconnect_device断开与当前设备的连接
查看
工具功能
another_take_screenshot将屏幕截取为 PNG 图像
输入
工具功能
another_press_button按下硬件按钮:home、back、recents、power、volume_up、volume_down
another_send_text在当前聚焦的输入框中输入文本
another_send_touch在归一化坐标(0.0-1.0)处发送触摸事件(down、up、move)
another_send_scroll在指定位置按给定增量滚动
another_swipe从一个点滑动到另一个点(归一化坐标 0.0-1.0)
应用与 Shell
工具功能
another_launch_app按包名启动应用(例如 com.android.chrome)
another_open_url在设备的默认浏览器中打开 URL
another_shell运行任意 adb shell 命令并获取输出
WiFi
工具功能
another_wifi_enable将 USB 设备切换到 WiFi 调试模式
another_wifi_connect通过 IP 地址连接到设备
another_wifi_disconnect断开 WiFi 设备的连接
another_get_device_ip获取通过 USB 连接的设备的 WiFi IP 地址

坐标系

触摸、滑动和滚动工具使用范围为 0.0 到 1.0 的归一化坐标:

  • (0.0, 0.0) = 左上角
  • (1.0, 1.0) = 右下角
  • (0.5, 0.5) = 屏幕中心

常见操作模式

点按某个项目
another_send_touch { action: "down", x: 0.5, y: 0.5 }
another_send_touch { action: "up", x: 0.5, y: 0.5 }
点按后验证
1. another_take_screenshot  (see what's on screen)
2. another_send_touch       (tap where you need to)
3. another_take_screenshot  (verify the result)
在输入框中输入
1. Tap the input field with another_send_touch
2. another_send_text { text: "hello world" }
向下滚动页面
another_send_scroll { x: 0.5, y: 0.5, dx: 0.0, dy: -1.0 }
滑动以返回或导航
another_swipe { from_x: 0.0, from_y: 0.5, to_x: 0.5, to_y: 0.5 }
使用按钮导航
another_press_button { button: "home" }
another_press_button { button: "back" }
another_press_button { button: "recents" }
打开应用并交互
1. another_launch_app { package: "com.android.chrome" }
2. Wait briefly, then another_take_screenshot
3. Interact as needed
查找屏幕上的元素

截屏并检查图像以确定元素的位置,然后使用坐标进行交互。屏幕截图是了解设备上可见内容的主要方式。

运行 Shell 命令
another_shell { command: "pm list packages" }
another_shell { command: "dumpsys battery" }
another_shell { command: "settings get system screen_brightness" }

提示

  • 交互前务必先截屏。你需要查看屏幕,才能知道要点按的位置。
  • 操作后截屏,确认操作成功。
  • 对于无需查看屏幕的操作(例如检查电池、列出软件包、获取设备信息),请使用 Shell 命令。
  • 滑动时长默认值为 300ms。增大 duration_ms 可让滑动更慢、更从容。
  • 操作前先连接。press_button、send_text、send_touch 和 swipe 等工具需要通过 another_connect_device 建立有效连接。
  • list_devices、shell、take_screenshot 和 wifi_* 工具无需 scrcpy 连接,只需要 adb。

评论

支持 Markdown