HarmonyOS device control and UI automation via raw HDC commands. Use for device/emulator discovery, USB or TCP connection, app launch/force-stop, tap/swipe/keyevent/text input, screenshots, UI dump, file transfer, and HDC troubleshooting.
Reference for controlling HarmonyOS devices with raw hdc commands.
hdc -t <device_id> whenever more than one device is connected.hdc -t DEVICE shell wm size.# Start HDC server
hdc start
# Stop HDC server
hdc kill
# List targets
hdc list targets
# Target a specific device
hdc -t DEVICE <command>
# Connect over TCP
hdc tconn <ip>:<port>
# Disconnect target
hdc -t DEVICE tdis
# Device model/system info
hdc -t DEVICE shell param get const.product.model
hdc -t DEVICE shell param get const.ohos.fullname
# Screen size
hdc -t DEVICE shell wm size
# Foreground focus window
hdc -t DEVICE shell hidumper -s WindowManagerService -a '-a'
# Run raw shell command
hdc -t DEVICE shell <command>
# List installed bundles
hdc -t DEVICE shell bm dump -a
# Start an ability
hdc -t DEVICE shell aa start -a <ability_name> -b <bundle_name>
# Start by URI
hdc -t DEVICE shell aa start -U <uri>
# Force-stop app by bundle
hdc -t DEVICE shell aa force-stop <bundle_name>
# Tap
hdc -t DEVICE shell uitest uiInput click X Y
# Double tap
hdc -t DEVICE shell uitest uiInput click X Y && sleep 0.1 && hdc -t DEVICE shell uitest uiInput click X Y
# Long press
hdc -t DEVICE shell uitest uiInput longClick X Y
# Swipe
hdc -t DEVICE shell uitest uiInput swipe X1 Y1 X2 Y2 [duration_ms]
# Key event
hdc -t DEVICE shell uitest uiInput keyEvent Back
hdc -t DEVICE shell uitest uiInput keyEvent Home
hdc -t DEVICE shell uitest uiInput keyEvent Enter
# Text input (Harmony text input supports UTF-8)
hdc -t DEVICE shell uitest uiInput inputText "hello world"
# Capture screenshot on device
hdc -t DEVICE shell snapshot_display -f /data/local/tmp/screen.jpeg
# Pull screenshot to local
hdc -t DEVICE file recv /data/local/tmp/screen.jpeg ./screen.jpeg
# Dump UI tree (JSON)
hdc -t DEVICE shell uitest dumpLayout -p /data/local/tmp/layout.json
hdc -t DEVICE file recv /data/local/tmp/layout.json ./layout.json
# Push file to device
hdc -t DEVICE file send ./local.file /data/local/tmp/remote.file
# Pull file from device
hdc -t DEVICE file recv /data/local/tmp/remote.file ./remote.file
# Install HAP
hdc -t DEVICE install /path/to/app.hap
# Install with replace
hdc -t DEVICE install -r /path/to/app.hap
# Uninstall by bundle
hdc -t DEVICE uninstall <bundle_name>
| KeyEvent | Description |
|---------|-------------|
| Back | Back button |
| Home | Home button |
| Enter | Enter/confirm |
| Power | Power button |
| VolumeUp | Volume up |
| VolumeDown | Volume down |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer