Coding

Android GUI Automation

Try it

Automate Android apps via Termux using uiautomator2 or Tasker for clicks, swipes, screenshots, text extraction, price tracking, and scheduled tasks.

What it does

让 MiniMax(或其他 MCP Client)通过 MCP 协议直接调用 uiautomator2,像真人一样控制 Android 手机屏幕。

The skill document

Android GUI Automation

让 MiniMax(或其他 MCP Client)通过 MCP 协议直接调用 uiautomator2,像真人一样控制 Android 手机屏幕。

架构

MiniMax API (MCP Client)
    ↓ MCP 调用
uiautomator2-mcp (在 Termux 里跑)
    ↓ uiautomator2
Android 手机屏幕 ← USB/无线 ADB

核心优势:

  • MiniMax 直接理解用户意图
  • MCP Tools 自动暴露所有手机操作能力
  • 45 个现成工具,包括 tap_sequence(复合步骤序列)
  • 不需要写死步骤,AI 自己拆解任务

第一步:Termux 安装

pkg install python python-pip
pip install uiautomator2 uiautomator2-mcp pillow requests schedule
python -m uiautomator2 init

第二步:启动 MCP Server

# 方式A: 直接运行(stdio 模式,AI 通过 stdin/stdout 调用)
uiautomator2-mcp

# 方式B: SSH 远程调用(从其他机器连接手机)
ssh user@phone-ip 'cd /path/to/project && uiautomator2-mcp'

第三步:MiniMax MCP 配置

在 MiniMax MCP 配置里添加:

{
  "mcpServers": {
    "android": {
      "command": "ssh",
      "args": ["user@phone-ip", "uiautomator2-mcp"]
    }
  }
}

45 个可用 MCP Tools

连接 & 设备

Tool说明
list_devices列出 ADB 可见的所有设备
connect连接设备(IP:5555 或自动发现)
device_info获取机型/屏幕/系统版本
current_app获取当前前台 APP

点击 & 滑动

Tool说明
tap点击坐标
double_tap双击坐标
long_tap长按坐标
multi_tap多次点击
swipe滑动(两点之间)
drag拖拽
press_key按键(home/back/enter/power)

输入

Tool说明
input_text输入文字
set_element_text设置元素文字

元素定位

Tool说明
find_element查找元素(text/resourceID/class/xpath)
tap_element查找并点击元素
double_tap_element查找并双击元素
element_exists检查元素是否存在
wait_element等待元素出现

⭐ 复合操作(最强大)

Tool说明
tap_sequence一次执行多步操作序列
// tap_sequence 示例:淘宝搜索 iPhone
{
  "action": "tap_sequence",
  "steps": [
    {"action": "tap_element", "text": "搜索"},
    {"action": "wait", "timeout": 2},
    {"action": "input_text", "text": "iPhone 16 256GB"},
    {"action": "press_key", "key": "enter"},
    {"action": "wait", "timeout": 3},
    {"action": "screenshot", "save_path": "/sdcard/result.png"}
  ]
}

截图 & UI 分析

Tool说明
screenshot截图(可返回 base64 给 AI 分析)
dump_hierarchy获取 XML 界面结构
get_ui_tree获取 JSON 格式完整 UI 树

APP 管理

Tool说明
app_start启动 APP
app_stop停止 APP
app_install安装 APK
app_clear清空 APP 数据
app_info获取 APP 信息

设备控制

Tool说明
screen_on亮屏
screen_off灭屏
unlock解锁
open_notification打开通知栏
get_clipboard读剪贴板
set_clipboard写剪贴板

文件 & Shell

Tool说明
push_file推文件到手机
pull_file从手机拉文件
shell在手机上执行 shell

日志

Tool说明
get_logs读取 logcat 日志
clear_logs清空日志

使用示例

示例1:淘宝搜索商品

用户: "帮我去淘宝搜 iPhone 16 多少钱"

MiniMax MCP 调用:
1. tap_sequence([
     {action:"tap_element", text:"搜索"},
     {action:"input_text", text:"iPhone 16 256GB"},
     {action:"press_key", key:"enter"},
     {action:"wait", timeout:3}
   ])
2. screenshot(inline=true)  →  AI 视觉读价格

示例2:小红书发笔记

用户: "帮我发一条小红书,内容是今天发现超好用的AI工具"

MiniMax MCP 调用:
tap_sequence([
  {action:"tap_element", text:"发布"},
  {action:"wait", timeout:2},
  {action:"tap_element", text:"选择照片"},
  {action:"wait", timeout:1},
  {action:"tap", x:540, y:960},  // 选第一张
  {action:"tap_element", text:"完成"},
  {action:"wait", timeout:1},
  {action:"input_text", text:"今天发现一个超好用的AI工具!#AI工具"},
  {action:"tap_element", text:"发布"},
  {action:"wait", timeout:3}
])

示例3:多平台比价

用户: "帮我对比 iPhone 16 在淘宝、拼多多、京东的价格"

MiniMax 循环调用3次:
for platform in [taobao, pinduoduo, jd]:
  1. app_start(package=platform)
  2. tap_sequence([搜索 → 输入iPhone16 → 等待结果])
  3. screenshot(inline=true) → AI 读价格
汇总 → 生成对比 → 发 Telegram

APP 包名速查

APP包名搜索比价发帖
淘宝com.taobao.taobao✅✅✅
拼多多com.xunmeng.pinduoduo✅✅❌
小红书com.xingin.xhs✅✅✅
抖音com.ss.android.ugc.aweme✅⚠️✅
京东com.jingdong.app.mall✅✅❌
微信com.tencent.mm✅❌✅

定时任务 & 通知

# crontab 定时执行(Termux 里)
0 9,20 * * * python3 price_monitor.py >> ~/logs/price.log 2>&1
# price_monitor.py — 用 MCP call 包装
import subprocess, json

def mcp_call(tool, **kwargs):
    req = {"jsonrpc":"2.0","method":"tools/call",
           "params":{"name":tool,"arguments":kwargs},"id":1}
    proc = subprocess.Popen(
        ["ssh", "phone-ip", "uiautomator2-mcp"],
        stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True
    )
    out, _ = proc.communicate(input=json.dumps(req)+"\n")
    return json.loads(out)

已知限制

场景支持
标准 UI APP✅
游戏/Unity APP❌
银行加固 APP⚠️
滑动验证码⚠️ 需打码平台
人脸验证❌

参考

Related skills

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai22 installs8 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván559 installs18 stars

More from smseow001

Browse all skills

AI architecture diagram generator supporting Mermaid charts. Generate system architecture, cloud architecture, neural network, graph theory, flowchart, ER di...

by SMS41 installs1 stars

让AI代理控制浏览器自动化网页操作。支持 Claude/GPT/Gemini/Ollama,可执行填表、购物、搜索等任务。

by smseow00120 installs

谷歌开源 AI 编程工作流 - 从需求到代码的快速转化。包含20个专项技能、规范开发流程、7大实战案例。

by smseow00117 installs

ComfyUI V8 秋叶中文版 全流程助手。提供安装检测、一键启动、工作流生成(文生图/图生图/ControlNet/InstantID等)、参数优化、故障排查、批量生成、模型管理等功能。All-in-one assistant for ComfyUI V8 (Aki bundle) with workflow...

by smseow00117 installs

硅谷多智能体量化交易系统 - 三级架构(研究员/分析师/交易员)+ 完整量化流程 + 新手平台推荐 + 策略指南。

by smseow00114 installs

将 OpenClaw 升级为 Claude-Code 引擎架构 - 并发执行/自我反思/向量检索/子代理系统/上下文压缩

by smseow00114 installs