Adb Claw

SkillDB 作者 dionren v1.6.1

Your eyes, hands, and ears on Android. See the screen (screenshot + indexed UI tree), interact (tap, swipe, scroll, type, clear-field), navigate via deep links (bypass CJK text input limits), wait for UI state changes instead of polling, monitor live UI text via accessibility framework (works during video playback), capture system audio (Android 11+, WAV stream for piping to ASR tools), manage full app lifecycle (install/uninstall/clear), control screen (on/off/unlock/rotation), run shell commands, and transfer files. Agent-optimized: structured JSON output, indexed element targeting, and App Profiles with pre-built deep links and layouts for popular apps.

源码 ↗

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install skilldb:dionren~adb-claw
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/skilldb%3Adionren~adb-claw/file -o adb-claw.md
Git 仓库获取源码
git clone https://github.com/openclaw/skills/commit/2dfbcdd6071563b29e39decb6d245517fe450d8c
# 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:

```bash
claude plugin add llm-net/adb-claw
```

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:

```
"Take a screenshot of my phone"
"Open Douyin and search for 猫咪"
"Tap the Login button"
"Monitor the live stream chat for 30 seconds"
```

Claude reads the Triggers list below and automatically activates this skill when your message matches — no explicit invocation required.

### OpenClaw

Install from ClawHub:

```bash
claw install adb-claw
```

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
2. **adb** — Android Debug Bridge (from Android SDK Platform-Tools)

### Install adb-claw

Installed automatically by the plugin. For manual installation, see [GitHub Releases](https://github.com/llm-net/adb-claw/releases).

### Install adb

```bash
# macOS
brew install android-platform-tools

# Linux (Debian/Ubuntu)
sudo apt install android-tools-adb
```

### 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
2. Go to **About phone** (some phones: Settings → My device)
3. Tap **Build number** (or MIUI version) **7 times** — a toast confirming Developer Mode is enabled will appear
4. 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
6. Connect phone to computer via USB cable
7. A dialog "Allow USB debugging?" will appear on the phone — tap **Allow** (check "Always allow from this computer" for convenience)

#### Verify connection

```bash
adb-claw doctor    # Checks adb, device connection, and capabilities
```

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**:

```bash
# 1. See what's on screen
adb-claw observe --width 540

# 2. Act on what you see (use element index from observe output)
adb-claw tap --index 3

# 3. Verify the result
adb-claw observe --width 540
```

For CJK apps, use deep links to bypass text input limits:

```bash
# Search in Douyin (Chinese TikTok) — no manual typing needed
adb-claw open 'snssdk1128://search/result?keyword=猫咪'

# Wait for results to load
adb-claw wait --text "综合" --timeout 5000
```

## 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 (抖音) | `douyin.md` | 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
2. Check `skills/apps/` for a matching Profile
3. Has Profile → use deep links and known layouts (fast path)
4. No Profile → `observe` + explore (slow path)
5. 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 |
|------|-------|-------------|---------|
| `--serial` | `-s` | Target device serial (when multiple devices connected) | auto-detect |
| `--output` | `-o` | Output format: `json`, `text`, `quiet` | `json` |
| `--timeout` | | Command timeout in milliseconds | `30000` |
| `--verbose` | | Enable de