ClawPaw Phone Control
Execute user instructions on the phone step by step using the ClawPaw MCP tools.
The MCP tools are available directly — no curl, no API calls needed.
Available MCP Tools
UI / Interaction
snapshot — Get the UI element tree (text, resource IDs, bounds, clickable state)
tap — Tap by coordinates OR by text/resourceId/contentDesc
long_press — Long press at x/y
swipe — Swipe by direction shortcut (up/down/left/right) or explicit coordinates
type_text — Type text into the focused field (supports Chinese, emoji)
press_key — Press a key: home, back, enter, delete, wakeup, volume_up, volume_down, etc.
screenshot — Take a screenshot (returns PNG image)
Device Info
battery — Battery level, charging state, temperature
location — GPS coordinates
network — WiFi / mobile data status
storage — Storage usage
screen_state — Screen on/off, locked
Hardware
flashlight — Get or set flashlight. Use on=true to turn on, on=false to turn off, omit to get state. Never pass action — only on: boolean.
volume — Get or set volume (stream: media/ring/alarm/notification, level: 0-15)
brightness — Get or set screen brightness (level: 0-255)
vibrate — Vibrate device (duration ms)
ringtone_mode — Get or set ringer mode (silent/vibrate/normal)
media_control — Control playback (action: play/pause/toggle/next/previous/stop)
Media
camera_snap — Take a photo (back/front camera)
audio_record — Record audio (action: capture/start/stop)
audio_status — Check if recording is in progress
sensors — Read accelerometer, gyroscope, light, etc.
Prerequisites — Check Before Starting
ADB connectivity
If ADB commands fail (tap has no effect, snapshot empty), confirm:
- USB debugging enabled: Settings → Developer options → USB debugging
- Device authorized:
shell → adb devices → should show device (not unauthorized)
- If unauthorized: disconnect/reconnect USB, accept the prompt on the phone
ADB Keyboard (required for Chinese / emoji / non-ASCII input)
type_text with Chinese or emoji requires ADBKeyboard — standard IME cannot receive arbitrary Unicode via ADB.
Setup:
- Install APK:
adb install ADBKeyboard.apk (download from GitHub: senzhk/ADBKeyBoard)
- Enable in settings: Language & Input → Virtual keyboard → Manage keyboards → ADB Keyboard ON
- Set active:
shell tool → ime set com.android.adbkeyboard/.AdbIME
- Verify:
shell → ime list -s should include com.android.adbkeyboard/.AdbIME
If type_text produces wrong output or does nothing, re-run step 3 to reactivate ADBKeyboard.
Core Principles
snapshot FIRST — screenshot is a fallback
Always use snapshot before acting on the screen. It returns real device-pixel bounds — use those for all taps and interactions.
| Goal |
Tool |
| Read screen content / find elements |
snapshot |
| Tap / type / interact with elements |
snapshot to get coords, then act |
| Verify a visual result after an action |
screenshot |
| snapshot returns no useful elements (image, video, game) |
screenshot as fallback |
Rules:
- NEVER guess coordinates from a screenshot — screenshots may be scaled; bounds from
snapshot are accurate
- Do not call
screenshot unless: (a) user needs to see the screen visually, or (b) snapshot returned nothing useful
screenshot is a fallback, not the default observation tool
Tapping elements
- Call
snapshot — get element list with bounds
- The
tap tool can match by text, resourceId, or contentDesc — use that when possible
- If using raw coordinates: compute center from bounds
[left,top][right,bottom] → x=(left+right)/2, y=(top+bottom)/2
Standard Execution Loop
For any user task:
- Wake screen —
press_key wakeup
- snapshot — read the current screen state
- Navigate —
press_key home + tap, or shell am start if needed
- snapshot — find element coordinates before acting
- Act — tap, type, swipe
- snapshot — verify result by reading updated UI state
- screenshot — only if the user needs to see the screen visually, or snapshot gives no useful info
- Repeat until done
Common Patterns
Send an SMS
1. shell (via adb): am start -a android.intent.action.SENDTO -d sms:<PHONE> --es sms_body <TEXT> --ez exit_on_sent true
2. snapshot → find send button by contentDesc="发送短信"
3. tap with contentDesc="发送短信" ← tap tool supports this directly
Open an app
tap with text="<app name>" ← if visible on home screen
-- or --
press_key home, then tap the app icon
Scroll
swipe with direction="up" ← scroll down (swipe up)
swipe with direction="down" ← scroll up (swipe down)
Type into a field
1. tap the input field (by text/resourceId)
2. type_text with the text to enter
Troubleshooting
| Symptom |
Fix |
| Screen is black / screenshot all dark |
press_key wakeup first |
| Tap has no effect |
Use snapshot → tap by text or contentDesc instead of coordinates |
| Element not found by text |
Try snapshot to see all visible elements and their exact text |
| Chinese / emoji not typed correctly |
ADBKeyboard not active — run shell: ime set com.android.adbkeyboard/.AdbIME |
| type_text does nothing |
ADBKeyboard not installed — see Prerequisites section above |
| ADB commands silently fail |
Check adb devices — device may be unauthorized; reconnect USB and accept prompt |
1---2name: clawpaw-control3description: Execute user instructions on the phone via ClawPaw MCP tools. Use when a user wants to do something on the phone — send a message, open an app, tap something, take a screenshot, etc.4---56# ClawPaw Phone Control78Execute user instructions on the phone step by step using the ClawPaw MCP tools.910The MCP tools are available directly — no curl, no API calls needed.1112## Available MCP Tools1314### UI / Interaction15- **`snapshot`** — Get the UI element tree (text, resource IDs, bounds, clickable state)16- **`tap`** — Tap by coordinates OR by text/resourceId/contentDesc17- **`long_press`** — Long press at x/y18- **`swipe`** — Swipe by direction shortcut (`up`/`down`/`left`/`right`) or explicit coordinates19- **`type_text`** — Type text into the focused field (supports Chinese, emoji)20- **`press_key`** — Press a key: `home`, `back`, `enter`, `delete`, `wakeup`, `volume_up`, `volume_down`, etc.21- **`screenshot`** — Take a screenshot (returns PNG image)2223### Device Info24- **`battery`** — Battery level, charging state, temperature25- **`location`** — GPS coordinates26- **`network`** — WiFi / mobile data status27- **`storage`** — Storage usage28- **`screen_state`** — Screen on/off, locked2930### Hardware3132- **`flashlight`** — Get or set flashlight. Use `on=true` to turn on, `on=false` to turn off, omit to get state. **Never pass `action` — only `on: boolean`.**33- **`volume`** — Get or set volume (stream: media/ring/alarm/notification, level: 0-15)34- **`brightness`** — Get or set screen brightness (level: 0-255)35- **`vibrate`** — Vibrate device (duration ms)36- **`ringtone_mode`** — Get or set ringer mode (silent/vibrate/normal)37- **`media_control`** — Control playback (action: play/pause/toggle/next/previous/stop)3839### Media40- **`camera_snap`** — Take a photo (back/front camera)41- **`audio_record`** — Record audio (action: capture/start/stop)42- **`audio_status`** — Check if recording is in progress43- **`sensors`** — Read accelerometer, gyroscope, light, etc.4445## Prerequisites — Check Before Starting4647### ADB connectivity48If ADB commands fail (tap has no effect, snapshot empty), confirm:491. USB debugging enabled: Settings → Developer options → USB debugging502. Device authorized: `shell` → `adb devices` → should show `device` (not `unauthorized`)513. If unauthorized: disconnect/reconnect USB, accept the prompt on the phone5253### ADB Keyboard (required for Chinese / emoji / non-ASCII input)54`type_text` with Chinese or emoji **requires ADBKeyboard** — standard IME cannot receive arbitrary Unicode via ADB.5556**Setup:**571. Install APK: `adb install ADBKeyboard.apk` (download from GitHub: senzhk/ADBKeyBoard)582. Enable in settings: Language & Input → Virtual keyboard → Manage keyboards → ADB Keyboard ON593. Set active: `shell` tool → `ime set com.android.adbkeyboard/.AdbIME`604. Verify: `shell` → `ime list -s` should include `com.android.adbkeyboard/.AdbIME`6162If `type_text` produces wrong output or does nothing, re-run step 3 to reactivate ADBKeyboard.6364## Core Principles6566### snapshot FIRST — screenshot is a fallback6768**Always use `snapshot` before acting on the screen.** It returns real device-pixel bounds — use those for all taps and interactions.6970| Goal | Tool |71|------|------|72| Read screen content / find elements | **`snapshot`** |73| Tap / type / interact with elements | **`snapshot`** to get coords, then act |74| Verify a visual result after an action | **`screenshot`** |75| snapshot returns no useful elements (image, video, game) | **`screenshot`** as fallback |7677**Rules:**78- **NEVER guess coordinates from a screenshot** — screenshots may be scaled; bounds from `snapshot` are accurate79- Do not call `screenshot` unless: (a) user needs to see the screen visually, or (b) `snapshot` returned nothing useful80- `screenshot` is a fallback, not the default observation tool8182### Tapping elements831. Call `snapshot` — get element list with bounds842. The `tap` tool can match by `text`, `resourceId`, or `contentDesc` — use that when possible853. If using raw coordinates: compute center from bounds `[left,top][right,bottom]` → `x=(left+right)/2`, `y=(top+bottom)/2`8687## Standard Execution Loop8889For any user task:90911. **Wake screen** — `press_key wakeup`922. **snapshot** — read the current screen state933. **Navigate** — `press_key home` + tap, or `shell am start` if needed944. **snapshot** — find element coordinates before acting955. **Act** — tap, type, swipe966. **snapshot** — verify result by reading updated UI state977. **screenshot** — only if the user needs to see the screen visually, or snapshot gives no useful info988. **Repeat** until done99100## Common Patterns101102### Send an SMS103```1041. shell (via adb): am start -a android.intent.action.SENDTO -d sms:<PHONE> --es sms_body <TEXT> --ez exit_on_sent true1052. snapshot → find send button by contentDesc="发送短信"1063. tap with contentDesc="发送短信" ← tap tool supports this directly107```108109### Open an app110```111tap with text="<app name>" ← if visible on home screen112-- or --113press_key home, then tap the app icon114```115116### Scroll117```118swipe with direction="up" ← scroll down (swipe up)119swipe with direction="down" ← scroll up (swipe down)120```121122### Type into a field123```1241. tap the input field (by text/resourceId)1252. type_text with the text to enter126```127128## Troubleshooting129130| Symptom | Fix |131|---------|-----|132| Screen is black / screenshot all dark | `press_key wakeup` first |133| Tap has no effect | Use `snapshot` → tap by `text` or `contentDesc` instead of coordinates |134| Element not found by text | Try `snapshot` to see all visible elements and their exact text |135| Chinese / emoji not typed correctly | ADBKeyboard not active — run `shell`: `ime set com.android.adbkeyboard/.AdbIME` |136| type_text does nothing | ADBKeyboard not installed — see Prerequisites section above |137| ADB commands silently fail | Check `adb devices` — device may be unauthorized; reconnect USB and accept prompt |