agent-android
/install agent-android
\r
Android REPL\r
\r
Use this skill to drive an Android device through the public agent-android beta surface published in the aivanelabs/ai-rpa repo.
Runtime prerequisites:
agent-androidis available onPATH- if it is missing, install the CLI with
uv tool install aivane-agent-android; then runuv tool update-shellif the command is still not found - the user has provided a trusted device URL such as
http://\x3Cdevice-ip>:8080\r The public path is local-first:\r \r - the phone hosts the lightweight HTTP service locally\r
- the desktop connects directly to
http://\x3Cdevice-ip>:8080\r - UI reads, taps, inputs, and screenshots stay on the phone and controlling machine\r
- the current tradeoff is LAN-only control; an optional server-side or relay path may arrive later\r
\r
If an
agent-androidcommand suddenly stops working, first check whether the AIVane app or its local API service has exited on the phone.
Safety Boundaries
- Connect only to a device URL explicitly provided by the user.
- Do not scan local networks or guess device IP addresses.
- Treat UI trees and screenshots as sensitive because they may contain private app content.
- Save screenshots or raw UI dumps only when the user explicitly asks for a file output.
- Ask for confirmation before operating sensitive apps, private content, account settings, or irreversible actions.
- Do not expose the phone-side service on a public network.
Core Workflow
\r Every Android control task should follow the same short loop:\r \r
- Confirm connectivity with
/health\r - Discover the target app with
appsif needed\r - Launch one app\r
- Inspect the current UI tree\r
- Perform one action\r
- Inspect again\r \r Keep the loop short. Prefer inspect -> act -> inspect over long speculative command chains.\r \r
Quick Start\r
\r Start the REPL with the user-provided device URL:
agent-android --repl --url http://\x3Cdevice-ip>:8080
Built-in help:
agent-android --help- In the REPL:
h\r
Essential CLI Commands\r
\r Use the one-off CLI when you already know the exact action you want.\r \r Connectivity:
agent-android --health --url http://\x3Cdevice-ip>:8080
Discovery:
agent-android --apps --url http://\x3Cdevice-ip>:8080agent-android --list --url http://\x3Cdevice-ip>:8080agent-android --id com.example:id/search --url http://\x3Cdevice-ip>:8080agent-android --text Search --url http://\x3Cdevice-ip>:8080agent-android --inputs --url http://\x3Cdevice-ip>:8080agent-android --refId 7 --url http://\x3Cdevice-ip>:8080agent-android --xpath 7 --url http://\x3Cdevice-ip>:8080agent-android --get-attr 7 text --url http://\x3Cdevice-ip>:8080
Actions:
agent-android --launch com.xingin.xhs --url http://\x3Cdevice-ip>:8080agent-android --tap 7 --url http://\x3Cdevice-ip>:8080agent-android --input 7 "hello world" --url http://\x3Cdevice-ip>:8080agent-android --swipe up --url http://\x3Cdevice-ip>:8080agent-android --back --url http://\x3Cdevice-ip>:8080agent-android --press home --url http://\x3Cdevice-ip>:8080agent-android --screenshot --url http://\x3Cdevice-ip>:8080
Waiting and output:
agent-android --wait-for Search --timeout 30 --url http://\x3Cdevice-ip>:8080agent-android --list --raw --url http://\x3Cdevice-ip>:8080\r
REPL Command Reference\r
\r Use the REPL for exploratory tasks and smoke runs. Short aliases and long names both work.\r \r
Browse\r
\r
healthorhl\r Check/health.\rl [n]orlist [n]\r List the firstnelements, or all cached elements whennis omitted.\rssorsnapshot\r Force-refresh the UI tree and print it again.\rf \x3Ctext>orfind \x3Ctext>\r Filter by text or content description.\rid \x3CresourceId>\r Filter by Android resource ID.\rref \x3CrefId>\r Show the full element detail for one refId.\rx \x3CrefId>orxpath \x3CrefId>\r Generate XPath candidates and validate their runtime match counts.\rxx \x3CrefId>\r Tap by the best unique generated XPath candidate. Refuses ambiguous matches.\rvx \x3Cxpath> [idx]orvalidatex \x3Cxpath> [idx]\r Validate one XPath against the runtime. Optionally inspect one match by zero-based index.\r \r
Interact\r
\r
t \x3CrefId>ortap \x3CrefId>\r Tap the element center point from the current tree.\rtx \x3Cxpath>ortapx \x3Cxpath>\r Tap one runtime-resolved XPath target.\ri \x3CrefId> \x3Ctext>orinput \x3CrefId> \x3Ctext>\r Input text into a refId target.\r Use--clearor""to clear instead of typing.\rix \x3Cxpath> \x3Ctext>orinputx \x3Cxpath> \x3Ctext>\r Input text into one XPath target.\r Useix \x3Cxpath> --or--clearto clear the field.\rsw \x3Cd|u|l|r> [--dur N] [--dist N]orswipe ...\r Swipe down/up/left/right with optional duration and distance.\rp \x3Cback|home|recents>orpress ...Press a system key.borback\r Press Back.\rla \x3Cpackage>orlaunch \x3Cpackage>\r Launch an app by package name.\rs [path]orscreenshot [path]\r Capture a screenshot to an auto-generated or explicit path.\r \r
Wait And Inspect\r
\r
wf \x3Ctext> [--t N]orwaitfor ...\r Wait for an element to appear.\rg \x3CrefId> \x3Cattr>orget \x3CrefId> \x3Cattr>\r Read an attribute such astext,class,bounds,x,y, orxpath.\rapps\r List launcher apps from/apps.\r \r
Session\r
\r
raw\r Toggle raw JSON mode.\rvarsShow current URL, timeout, raw mode, and tree cache state.set timeout 30Set the default wait timeout in seconds.horhelp\r Show the built-in help text.\rqorquit\r Exit the REPL.\r \r
Common Patterns\r
\r
First smoke flow\r
\r
- Start the REPL with
agent-android --repl --url http://\x3Cdevice-ip>:8080. healthappsla \x3Cpackage>lt \x3CrefId>i \x3CrefId> hellobs\r
Find the right package before launch
appsla com.example.appl\r
Inspect an element before using XPath
lref 12x 12vx //EditText[@text='Search']\r
Clear and refill an input
i 7 --cleari 7 hello worldix //EditText[@text='Search'] --ix //EditText[@text='Search'] -- hello world\r
Troubleshooting\r
\r
- If an
agent-androidcommand fails, first check whether the AIVane app or phone-side API service has exited. - If
agent-androidis not found, runuv tool update-shell, reopen the terminal, and retry. - Re-open the app or restart the phone-side service, then retry
curl http://\x3Cdevice-ip>:8080/health. - If
healthworks but UI commands fail, runssto force-refresh the tree before tapping or inputting.\r - If
txorixfails, runvx \x3Cxpath>and make sure the XPath resolves to exactly one runtime match.\r - If screenshots fail the first time, confirm the on-device MediaProjection permission prompt was accepted.\r
- If everything suddenly stops responding, confirm the phone IP did not change and that the desktop is still on the same LAN.\r \r
When To Stop\r
\r Stop and ask for user help when:\r \r
- the device is unreachable on LAN\r
- the app is not running and cannot be restarted from the current path\r
- required Android permissions are missing\r
- launcher discovery returns nothing useful\r
- the runtime UI no longer matches the expected screen after repeated refreshes\r \r
References\r
\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install agent-android - After installation, invoke the skill by name or use
/agent-android - Provide required inputs per the skill's parameter spec and get structured output
What is agent-android?
Control Android over LAN without USB, ADB, or root. It is an AI Agent Skill for Claude Code / OpenClaw, with 94 downloads so far.
How do I install agent-android?
Run "/install agent-android" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is agent-android free?
Yes, agent-android is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does agent-android support?
agent-android is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created agent-android?
It is built and maintained by CrazyTigerMan (@crazytigerman); the current version is v0.1.6.