Install
openclaw skills install android-control-2Control an Android device via command-line tools (uiautomator, screencap, input, am). Automatically attempts non-root execution first and falls back to root if necessary.
openclaw skills install android-control-2Control 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.
uiautomator dumpscreencapinputam startMost Android ROMs include uiautomator, input, screencap, and am.
To enable root fallback, install Magisk or run:
su
# 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"
)
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"
)
# Example: tap at (540, 1600)
input tap 540 1600 2>/dev/null \
|| su -c "input tap 540 1600"
# 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"
# Example: launch Android Settings
am start -n com.android.settings/.Settings 2>/dev/null \
|| su -c "am start -n com.android.settings/.Settings"
# Example: send text "Hello"
input text "Hello" 2>/dev/null \
|| su -c "input text 'Hello'"