ADB Claw — Android Device Control
Your eyes, hands, and ears on Android. See what's on screen, tap any element, scroll through content, open deep links, wait for UI changes, capture system audio, manage apps, and more — all through a single CLI with structured JSON output.
Why ADB Claw
Superpowers — What You Can't Get Elsewhere:
- - Live stream intelligence —
monitor connects to Android's accessibility framework, reading all UI text in real-time — even during video playback and live streams where uiautomator dump hangs. Chat messages, captions, dynamic overlays — data no other tool exposes to agents. - System audio capture —
audio capture records device audio via REMOTE_SUBMIX (Android 11+); streams WAV to stdout for piping to ASR tools. Combined with monitor, you get full sensory coverage: visual text + audio.
Core Strengths:
- - Observe → Act → Verify loop —
observe returns screenshot + indexed UI tree in one call; use element indices to target precisely across any screen size - Deep links bypass CJK limits —
adb input text can't type Chinese/Japanese/Korean; adb-claw open 'app://search?keyword=中文' can - Wait, don't poll —
wait --text "Done" blocks until the UI element appears, replacing fragile sleep/observe loops - Smart scroll — auto-calculates swipe coordinates from screen size; supports direction, page count, and scrolling within specific elements
- App Profiles — pre-built knowledge (deep links, layouts, known issues) for popular apps like Douyin; load once, skip trial-and-error
- Full app lifecycle — install, launch, stop, uninstall, clear data — no raw
adb needed - Agent-optimized JSON — every command returns
{ok, command, data, error, duration_ms} with actionable suggestion on errors - Minimal device footprint — nearly all operations are pure ADB commands; only
monitor and audio capture push temporary ~7KB helpers that auto-exit
Actively Evolving — new capabilities ship regularly. Each release expands what you can perceive and control on Android devices.
Getting Started
Claude Code
Install the plugin, then just talk to Claude — no slash commands needed:
CODEBLOCK0
The plugin auto-downloads the adb-claw binary on first session. Make sure adb is installed and a device is connected via USB with debugging enabled.
Then simply ask Claude to interact with your Android device:
CODEBLOCK1
Claude reads the Triggers list below and automatically activates this skill when your message matches — no explicit invocation required.
OpenClaw
Install from ClawHub:
CODEBLOCK2
Same natural-language triggers apply. Ask your agent to control an Android device and it will invoke adb-claw commands.
Triggers
These patterns tell the agent when to activate this skill:
- - User asks to control, interact with, or automate an Android device
- User asks to test a mobile app or UI on Android
- User mentions tapping, swiping, scrolling, screenshots, or app management on Android
- User wants to open a URL, deep link, or specific app screen on a connected device
- User wants to wait for UI elements to appear/disappear on Android
- User wants to manage screen state (on/off/unlock/rotation) on Android
- User wants to push/pull files to/from an Android device
- User wants to monitor live stream chat or read UI text during video playback on Android
- User wants to capture or record audio from an Android device
- User wants to grab shopping cart products from a Douyin live stream
- User wants to run shell commands on an Android device
Binary
The adb-claw binary is located at ${CLAUDE_PLUGIN_ROOT}/bin/adb-claw.
The binary is installed automatically via the SessionStart hook. If adb-claw is not available, inform the user that the plugin needs to be reinstalled — do not attempt to download or install it yourself.
Setup
Requires two binaries:
- 1. adb-claw — the control CLI
- adb — Android Debug Bridge (from Android SDK Platform-Tools)
Install adb-claw
Installed automatically by the plugin. For manual installation, see GitHub Releases.
Install adb
CODEBLOCK3
Connect device
The Android device must have USB debugging enabled and be connected via USB. This is the most common blocker — most users haven't turned it on. When a user first asks to control their phone, always check connection first (adb-claw doctor) and if it fails, walk them through the setup steps below before attempting any other commands.
How to enable USB debugging (guide the user through this)
- 1. Open Settings on the Android phone
- Go to About phone (some phones: Settings → My device)
- Tap Build number (or MIUI version) 7 times — a toast confirming Developer Mode is enabled will appear
- Go back to Settings → Additional settings → Developer options (path varies by brand):
- Xiaomi/Redmi: Settings → Additional settings → Developer options
- Samsung: Settings → Developer options
- Pixel/Stock: Settings → System → Developer options
- OPPO/Vivo: Settings → System management → Developer options
- 5. Enable USB debugging toggle
- Connect phone to computer via USB cable
- A dialog "Allow USB debugging?" will appear on the phone — tap Allow (check "Always allow from this computer" for convenience)
Verify connection
CODEBLOCK4
If doctor reports no device, ask the user to:
- - Check the USB cable (some cables are charge-only, no data)
- Try a different USB port
- Re-authorize USB debugging on the phone (revoke and re-allow)
- On some phones, change USB mode from "Charging" to "File Transfer" in the notification shade
Quick Start
The core loop is observe → decide → act → observe:
CODEBLOCK5
For CJK apps, use deep links to bypass text input limits:
CODEBLOCK6
App Profiles
App Profiles are pre-built knowledge bases for specific apps — deep links, UI layouts, device-specific behavior, and known issues. They dramatically reduce the trial-and-error needed to automate an app.
Available Profiles: skills/apps/ directory
| App | File | Key Content |
|---|
| Douyin (抖音) | INLINECODE19 | Search/user/live deep links, feed/search/profile layouts, Phone vs Pad differences, live stream chat monitoring |
| Meituan (美团) |
meituan.md | Search/waimai deep links, homepage/menu/search layouts, WebView workarounds, popup chain handling |
Usage:
- 1.
adb-claw app current → get foreground app package name - Check
skills/apps/ for a matching Profile - Has Profile → use deep links and known layouts (fast path)
- No Profile →
observe + explore (slow path) - Check device form factor:
adb-claw device info → short edge < 1200px = Phone, >= 1200px = Pad
Profiles are plain Markdown files. New app support = drop a .md file into skills/apps/.
Global Flags
| Flag | Short | Description | Default |
|---|
| INLINECODE27 | INLINECODE28 | Target device serial (when multiple devices connected) | auto-detect |
| INLINECODE29 |
-o | Output format:
json,
text,
quiet |
json |
|
--timeout | | Command timeout in milliseconds |
30000 |
|
--verbose | | Enable debug output to stderr |
false |
Commands
observe — Screenshot + UI Tree (Primary Command)
Captures screenshot and UI element tree in one call. Always use this before and after actions.
CODEBLOCK7
Returns: base64 PNG screenshot, indexed UI elements with text/id/bounds/center coordinates.
screenshot — Capture Screen
CODEBLOCK8
tap — Tap UI Element
Tap by element index (preferred), resource ID, text, or coordinates:
CODEBLOCK9
Always prefer --index over coordinates. Index values come from observe output.
long-press — Long Press
CODEBLOCK10
swipe — Swipe Gesture
CODEBLOCK11
type — Input Text (ASCII only)
CODEBLOCK12
Important: Only ASCII text is supported. For CJK/emoji input, use open with deep links (e.g., adb-claw open 'myapp://search?keyword=中文').
key — Press System Key
CODEBLOCK13
clear-field — Clear Input Field
Clear text in the currently focused input field. Optionally tap an element first to focus it.
CODEBLOCK14
Uses Ctrl+A+DEL on SDK 31+, falls back to repeated DEL on older devices.
open — Open URI (Deep Link)
Open any URI using Android's ACTION_VIEW intent. The key to CJK text input — pass Chinese/Japanese/Korean text as URL parameters in deep links.
CODEBLOCK15
scroll — Smart Scroll
Scroll the screen or a specific scrollable element. Auto-calculates swipe coordinates from screen size — no manual coordinate math needed.
CODEBLOCK16
Always prefer scroll over manual swipe for page navigation.
wait — Wait for UI Condition
Wait for a UI element or activity to appear or disappear. Replaces fragile sleep+observe polling loops with a single blocking call.
CODEBLOCK17
Default timeout: 10s. Default poll interval: 800ms.
screen — Screen Management
CODEBLOCK18
app — App Management
CODEBLOCK19
monitor — Continuous UI Text Monitoring
Monitor UI text by connecting directly to the Android accessibility framework. Unlike ui tree which uses uiautomator dump, this command skips video surface nodes and works reliably during live streams and video playback.
CODEBLOCK20
Bounded mode (default): runs for --duration ms, returns all unique text entries in a JSON envelope.
Streaming mode (--stream): outputs each new text as a JSON line in real time.
Default duration: 10s. Default poll interval: 2s.
Note: This command pushes a small (~7KB) DEX helper to the device on first use. The helper runs temporarily via app_process and exits when monitoring completes.
audio capture — System Audio Capture (Android 11+)
Capture system audio via REMOTE_SUBMIX. Streams WAV (16kHz mono 16-bit PCM) to stdout for piping to external tools, or saves to a file.
WARNING: Device speakers are muted while capturing.
CODEBLOCK21
Stream mode (default): outputs WAV to stdout — designed for piping:
CODEBLOCK22
File mode (--file): saves to local file and returns JSON envelope with file path, byte count, and duration.
Default duration: 10s. Default sample rate: 16000 Hz.
Requires Android 11+ (API 30). Like monitor, this command pushes a small DEX helper to the device on first use.
When to use audio capture vs monitor:
- -
monitor — read UI text (chat messages, labels, captions) as structured data - INLINECODE53 — record what's being heard (speech, music, sound effects) as audio
For live streams, they complement each other: monitor captures on-screen chat text while audio capture captures the streamer's voice.
live cart — Douyin Shopping Cart Capture (抖音小黄车)
Grab product information from a Douyin live stream shopping cart. Captures the currently explaining product (without opening the cart) and the first N products in the cart list.
This command is Douyin-specific — it relies on Douyin's UI patterns and accessibility node structure.
CODEBLOCK23
How it works:
- 1. Reads the "讲解中" floating card via accessibility (no cart open needed)
- Taps the shopping cart button to open the panel
- Scrolls slowly through products with continuous accessibility polling
- Stops when products 1..N are all captured (consecutive, no gaps)
- Closes the cart and outputs structured JSON
Returns: product number, title, price, sold count, shop name, tags for each product, plus the currently explaining product if any.
Must be used while viewing a Douyin live stream with a shopping cart.
shell — Run Raw Shell Command
Escape hatch for anything adb-claw doesn't have a dedicated command for.
CODEBLOCK24
Returns stdout, stderr, and exit_code in JSON envelope.
file — File Transfer
CODEBLOCK25
device — Device Info
CODEBLOCK26
ui — UI Element Inspection
CODEBLOCK27
Workflow Patterns
Always Observe First
Before any action, run observe to see the screen. After every action, observe again to verify.
CODEBLOCK28
Prefer Index-Based Targeting
Use --index N over coordinates. Indices from observe are stable across screen sizes.
Type After Focus
Always tap an input field first, then type:
CODEBLOCK29
Scroll Pattern
CODEBLOCK30
Always prefer scroll over manual swipe. After scrolling, always observe.
CJK Text Input
INLINECODE64 only supports ASCII. For Chinese/Japanese/Korean input:
- 1. Preferred: Use
adb-claw open with deep links (e.g., adb-claw open 'myapp://search?keyword=中文') - Clear before input:
adb-claw clear-field --index 7 to clear existing text first
Wait for Page Load
Instead of repeated observe polling, use wait:
CODEBLOCK31
Device Form Factor Detection
Use adb-claw device info to get screen size, then determine form factor:
- - Short edge < 1200px → Phone (portrait-first)
- Short edge >= 1200px → Pad/Fold (landscape-first)
Swipe coordinates and UI layouts differ between Phone and Pad. App Profiles document these differences.
Audio Capture
First check if the device supports it:
CODEBLOCK32
To record audio to a file for the user:
CODEBLOCK33
To transcribe live audio (requires asrclaw installed separately):
CODEBLOCK34
Important: Device speakers are muted during capture. Inform the user before starting. For live streams, combine with monitor for complete context (audio + chat text).
Douyin Live Cart
Grab shopping cart products from a Douyin live stream:
CODEBLOCK35
The command handles everything automatically: opens cart, scrolls, captures, closes. No manual tapping needed.
Error Recovery
If an action fails or produces unexpected results:
- 1. Run
observe to see the current state - Check if the screen changed unexpectedly (dialog, permission prompt)
- Adjust and retry
Output Format
All commands return JSON:
CODEBLOCK36
On error:
CODEBLOCK37
Security & Trust
What adb-claw is: A pure CLI wrapper around standard adb commands. It translates high-level instructions (e.g., adb-claw tap --index 3) into adb shell input tap ... calls. That's it.
What adb-claw does NOT do:
- - Does not install APKs or persistent services on the device —
monitor and audio capture each push a temporary ~7KB DEX that runs briefly and auto-exits - Does not collect or transmit data — no telemetry, no analytics, no network requests
- Does not request credentials or environment variables
- Does not modify your host system beyond placing the binary
Source code is fully open: github.com/llm-net/adb-claw. If you don't trust pre-built binaries, you can audit the source code and build from source — see the README for instructions. Every release also includes SHA256 checksums for binary verification.
Device sensitivity: adb-claw can capture screenshots, record system audio, and control apps on the connected device — this is the core purpose of the tool. Only connect devices you trust, and disable USB debugging when not actively using adb-claw.
Agent scope: adb-claw commands are the only commands this skill should execute. Do not run install scripts, download binaries, or modify the host system. If adb-claw or adb is not available, inform the user.
Troubleshooting
| Problem | Solution |
|---|
| No devices found | Walk the user through: Settings → About phone → tap Build number 7x → Developer options → enable USB debugging → reconnect USB → approve the "Allow USB debugging" dialog on phone. See Setup section for full guide |
| adb not found |
brew install android-platform-tools (macOS) |
| Tap hits wrong element | Use
--index instead of coordinates; re-run
observe |
|
type doesn't work | Tap input field first to focus; ASCII only |
| CJK text needed | Use
adb-claw open with deep link containing the text as URL parameter |
| UI dump fails | Pause animations (tap to pause video), wait 1s, retry |
| UI dump fails on search pages | Search results may auto-play video previews; use
screenshot instead or
monitor to read text |
| UI dump fails during live stream | Use
monitor command — it bypasses video surfaces via accessibility framework |
| Command timeout | Increase with
--timeout 60000 |
| Permission dialog | Use
observe to see it, tap the allow/skip button |
| Screen is off |
adb-claw screen on or
adb-claw screen unlock |
| Audio capture fails | Requires Android 11+ (API 30); check with
adb-claw device info |
| No audio captured | REMOTE_SUBMIX may not be available on all devices/ROMs |
| Speakers muted during capture | Expected behavior — REMOTE_SUBMIX redirects audio output |
ADB Claw — Android 设备控制
你的眼睛、双手和耳朵在Android上。查看屏幕内容、点击任意元素、滚动页面、打开深层链接、等待UI变化、捕获系统音频、管理应用等——全部通过一个带有结构化JSON输出的单一CLI实现。
为什么选择ADB Claw
超能力——其他地方无法获得的功能:
- - 实时流智能 — monitor 连接到Android的无障碍框架,实时读取所有UI文本——即使在视频播放和直播过程中,uiautomator dump 会挂起的情况下也能工作。聊天消息、字幕、动态覆盖层——其他工具无法向代理暴露的数据。
- 系统音频捕获 — audio capture 通过REMOTE_SUBMIX(Android 11+)录制设备音频;将WAV流输出到stdout,用于管道传输到ASR工具。与 monitor 结合使用,可获得完整的感官覆盖:视觉文本 + 音频。
核心优势:
- - 观察 → 行动 → 验证循环 — observe 在一次调用中返回截图 + 索引化UI树;使用元素索引在任何屏幕尺寸上精确定位
- 深层链接绕过CJK限制 — adb input text 无法输入中文/日文/韩文;adb-claw open app://search?keyword=中文 可以
- 等待,而非轮询 — wait --text Done 阻塞直到UI元素出现,替代脆弱的sleep/observe循环
- 智能滚动 — 根据屏幕尺寸自动计算滑动坐标;支持方向、页面数量以及在特定元素内滚动
- 应用配置文件 — 为抖音等流行应用预建的知识库(深层链接、布局、已知问题);加载一次,跳过试错
- 完整的应用生命周期 — 安装、启动、停止、卸载、清除数据——无需原始 adb
- 针对代理优化的JSON — 每个命令返回 {ok, command, data, error, duration_ms},错误时附带可操作的 suggestion
- 最小的设备占用 — 几乎所有操作都是纯ADB命令;只有 monitor 和 audio capture 会推送临时约7KB的辅助程序,自动退出
持续进化 — 新功能定期发布。每个版本都扩展你在Android设备上可以感知和控制的能力。
快速入门
Claude Code
安装插件,然后直接与Claude对话——无需斜杠命令:
bash
claude plugin add llm-net/adb-claw
插件在首次会话时自动下载adb-claw二进制文件。确保已安装 adb 并通过USB连接已启用调试的设备。
然后只需让Claude与你的Android设备交互:
给我的手机截个屏
打开抖音并搜索 猫咪
点击登录按钮
监控直播聊天30秒
Claude会读取下面的触发器列表,当你的消息匹配时自动激活此技能——无需显式调用。
OpenClaw
从ClawHub安装:
bash
claw install adb-claw
相同的自然语言触发器适用。让你的代理控制Android设备,它将调用adb-claw命令。
触发器
以下模式告诉代理何时激活此技能:
- - 用户要求控制、交互或自动化Android设备
- 用户要求测试Android上的移动应用或UI
- 用户提到在Android上点击、滑动、滚动、截图或应用管理
- 用户想在已连接设备上打开URL、深层链接或特定应用界面
- 用户想在Android上等待UI元素出现/消失
- 用户想在Android上管理屏幕状态(开/关/解锁/旋转)
- 用户想向Android设备推送/拉取文件
- 用户想在Android上监控直播聊天或在视频播放期间读取UI文本
- 用户想从Android设备捕获或录制音频
- 用户想从抖音直播中获取购物车商品
- 用户想在Android设备上运行shell命令
二进制文件
adb-claw二进制文件位于 ${CLAUDEPLUGINROOT}/bin/adb-claw。
二进制文件通过SessionStart钩子自动安装。如果 adb-claw 不可用,请告知用户需要重新安装插件——不要自行尝试下载或安装。
设置
需要两个二进制文件:
- 1. adb-claw — 控制CLI
- adb — Android调试桥(来自Android SDK Platform-Tools)
安装 adb-claw
由插件自动安装。如需手动安装,请参阅 GitHub Releases。
安装 adb
bash
macOS
brew install android-platform-tools
Linux (Debian/Ubuntu)
sudo apt install android-tools-adb
连接设备
Android设备必须启用USB调试并通过USB连接。 这是最常见的障碍——大多数用户尚未开启此功能。当用户首次要求控制手机时,始终先检查连接(adb-claw doctor),如果失败,引导他们完成以下设置步骤,然后再尝试其他命令。
如何启用USB调试(引导用户完成)
- 1. 在Android手机上打开设置
- 进入关于手机(部分手机:设置 → 我的设备)
- 连续点击版本号(或MIUI版本)7次——将出现确认开发者模式已启用的提示
- 返回设置 → 更多设置 → 开发者选项(路径因品牌而异):
- 小米/红米:设置 → 更多设置 → 开发者选项
- 三星:设置 → 开发者选项
- Pixel/原生:设置 → 系统 → 开发者选项
- OPPO/Vivo:设置 → 系统管理 → 开发者选项
- 5. 启用USB调试开关
- 通过USB数据线将手机连接到电脑
- 手机上会出现允许USB调试?对话框——点击允许(为方便起见,勾选始终允许来自此计算机)
验证连接
bash
adb-claw doctor # 检查adb、设备连接和功能
如果 doctor 报告没有设备,请让用户:
- - 检查USB数据线(有些数据线仅支持充电,不支持数据传输)
- 尝试不同的USB端口
- 在手机上重新授权USB调试(撤销并重新允许)
- 在某些手机上,从通知栏将USB模式从仅充电更改为文件传输
快速开始
核心循环是 观察 → 决策 → 行动 → 观察:
bash
1. 查看屏幕内容
adb-claw observe --width 540
2. 对所见内容采取行动(使用observe输出中的元素索引)
adb-claw tap --index 3
3. 验证结果
adb-claw observe --width 540
对于CJK应用,使用深层链接绕过文本输入限制:
bash
在抖音中搜索——无需手动输入
adb-claw open snssdk1128://search/result?keyword=猫咪
等待结果加载
adb-claw wait --text 综合 --timeout 5000
应用配置文件
应用配置文件是针对特定应用的预建知识库——深层链接、UI布局、设备特定行为和已知问题。它们大大减少了自动化应用所需的试错。
可用配置文件:skills/apps/ 目录
| 应用 | 文件 | 关键内容 |
|---|
| 抖音 | douyin.md | 搜索/用户/直播深层链接、信息流/搜索/个人资料布局、手机与平板差异、直播聊天监控 |
| 美团 |
meituan.md | 搜索/外卖深层链接、首页/菜单/搜索布局、WebView解决方法、弹窗链处理 |
用法:
- 1. adb-claw app current → 获取前台应用包名
- 检查 skills/apps/ 中是否有匹配的配置文件
- 有配置文件 → 使用深层链接和已知布局(快速路径)
- 无配置文件 → observe + 探索(慢速路径)
- 检查设备形态:adb-claw device info → 短边 < 1200px = 手机,>= 1200px = 平板
配置文件是纯Markdown文件。新增应用支持 = 将 .md 文件放入 skills/apps/。
全局标志
| 标志 | 简写 | 描述 | 默认值 |
|---|
| --serial | -s | 目标设备序列号(当连接多个设备时) | 自动检测 |
| --output |
-o | 输出格式:json、text、quiet | json |
| --timeout | | 命令超时时间(毫秒) | 30000 |
| --verbose | | 启用调试输出到stderr | false |
命令
observe — 截图 + UI树(主要命令)
在一次调用中捕获截图和UI元素树。始终在操作前后使用