← 返回
开发者工具 中文

Android Control

Control an Android device via command-line tools (uiautomator, screencap, input, am). Automatically attempts non-root execution first and falls back to root...
通过命令行工具(uiautomator、screencap、input、am)控制安卓设备。优先尝试非 root 执行,失败后自动回退至 root...
kv0768
开发者工具 clawhub v0.1.1 1 版本 99826.1 Key: 无需
★ 1
Stars
📥 1,128
下载
💾 1
安装
1
版本
#latest

概述

Android Control Skill

Control an Android phone directly from Clawdbot using built-in Android CLI tools.

The skill always tries normal (non-root) commands first; if they fail, it automatically retries with root mode (su) when available.

Features

  • Get UI hierarchy snapshot via uiautomator dump
  • Capture screen using screencap
  • Simulate taps, swipes, and input events via input
  • Launch apps using am start
  • Auto retry with root if non-root fails

Setup

Most Android ROMs include uiautomator, input, screencap, and am.

To enable root fallback, install Magisk or run:

su

Usage

Get UI Snapshot (uiautomator dump)

# Try non-root
uiautomator dump /sdcard/ui_dump.xml 2>/dev/null \
  && cat /sdcard/ui_dump.xml \
  || (
    # Fallback to root
    su -c "uiautomator dump /sdcard/ui_dump.xml" && su -c "cat /sdcard/ui_dump.xml"
  )

Take Screenshot (PNG, base64 encoded)

TMP="/sdcard/ai_screen.png"

# Try non-root
screencap -p "$TMP" 2>/dev/null \
  && base64 "$TMP" \
  || (
    # Root fallback
    su -c "screencap -p $TMP"
    su -c "base64 $TMP"
  )

Tap on Screen

# Example: tap at (540, 1600)

input tap 540 1600 2>/dev/null \
  || su -c "input tap 540 1600"

Swipe on Screen

# Example: swipe from (500, 1600) to (500, 600) over 300ms

input swipe 500 1600 500 600 300 2>/dev/null \
  || su -c "input swipe 500 1600 500 600 300"

Launch an App

# Example: launch Android Settings

am start -n com.android.settings/.Settings 2>/dev/null \
  || su -c "am start -n com.android.settings/.Settings"

Send Text Input

# Example: send text "Hello"

input text "Hello" 2>/dev/null \
  || su -c "input text 'Hello'"

版本历史

共 1 个版本

  • v0.1.1 当前
    2026-03-29 22:31 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 671 📥 324,378
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,315
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,826