Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoClaw

Headless AutoXJS bridge for Android automation.

AutoClaw lets a computer connect to an AutoXJS-enabled Android device, send scripts remotely, inspect UI, and build agent-driven mobile automation workflows without depending on the VS Code plugin UI.

Features

  • Connect AutoXJS devices through the built-in “connect to computer” flow
  • Run remote AutoXJS scripts
  • Save scripts to device
  • Stop one script or stop all scripts
  • Inspect current UI elements with AutoXJS selectors
  • Capture screenshots on device
  • Use a tiny local HTTP bridge for automation

Project structure

.
├── README.md
├── README.zh-CN.md
├── SKILL.md
├── examples/
│   └── autox_client_template.js
├── scripts/
│   ├── protocol.md
│   ├── send_run.py
│   └── server.js
├── package.json
└── package-lock.json

Requirements

  • Node.js 18+
  • AutoXJS on Android
  • Android device and computer on the same local network

Install

npm install

Install in OpenClaw

If you want to use AutoClaw as an OpenClaw skill from this repository, the simplest way is to clone it into your local skills directory.

Example:

git clone https://github.com/872226263/AutoClaw.git ~/.openclaw/workspace/skills/autoclaw

Then make sure your OpenClaw instance can see that skill directory.

Minimum expectation:

  • SKILL.md is at the repository root
  • helper scripts stay under scripts/
  • example files stay under examples/

After that, OpenClaw can load it as a normal local skill.

Start the bridge

node scripts/server.js

Default port:

  • 9317

Health check:

curl http://127.0.0.1:9317/health

Expected result:

{"ok":true,"connected":false,"port":9317}

AutoXJS download

If you need an AutoXJS app build to use with AutoClaw, use the community-maintained AutoX repository:

When publishing this project, prefer pointing users to that repository for AutoXJS installation rather than bundling APK files in this repo.

Connect an Android device

On the Android side:

  1. Open AutoXJS
  2. Use the built-in connect to computer / 调试服务 / 连接电脑 flow
  3. Enter:
<your-computer-ip>:9317

Example:

192.168.1.10:9317

After the device connects, the bridge will log a successful handshake.

Send a script

Use the helper script:

python3 scripts/send_run.py --name demo.js --code "toast('hello from AutoClaw')"

You can also send a file:

python3 scripts/send_run.py --name demo.js --file ./examples/demo.js

Common AutoXJS examples

Toast

toast("hello from AutoClaw")

Alert dialog

dialogs.alert("AutoClaw", "Hello from AutoClaw")

Launch app

launchApp("微信")

or

app.launchPackage("com.tencent.mm")

Click by text

var obj = text("登录").findOne(3000);
if (obj) obj.click();

Input text

setText("hello world")

Screenshot on device

requestScreenCapture();
var img = captureScreen();
images.save(img, "/sdcard/autoclaw-shot.png");
log("saved screenshot: /sdcard/autoclaw-shot.png");

Dump current UI tree

function walk(node, depth) {
  if (!node) return;
  var indent = new Array(depth + 1).join("  ");
  log(indent + JSON.stringify({
    text: node.text(),
    id: node.id(),
    desc: node.desc(),
    className: node.className(),
    clickable: node.clickable(),
    bounds: String(node.bounds())
  }));
  var count = node.childCount();
  for (var i = 0; i < count; i++) walk(node.child(i), depth + 1);
}
walk(depth(0).findOne(2000), 0);

HTTP API

Health

GET /health

Execute

GET /exec?cmd=run&path=remote.js&script=toast("hello")

Supported commands:

  • run
  • save
  • stop
  • stopAll

Security notes

  • Keep the bridge on a trusted local network
  • Do not expose it directly to the public internet without authentication
  • Do not use it on sensitive apps without explicit human confirmation
  • Review scripts before running risky actions

Current limitations

  • Screenshots are currently saved on the phone; they are not pulled back automatically yet
  • UI inspection currently returns results through device logs
  • Structured result return and file pullback are future improvements

Roadmap

  • Screenshot pullback
  • Structured JSON result return
  • Multi-device management
  • Authentication
  • Higher-level helpers for click/input/screenshot/UI dump

License

MIT (or your chosen license)

About

Headless AutoXJS bridge for Android automation. Connect AutoXJS devices, run scripts remotely, inspect UI, capture screenshots, and drive Android phones without relying on the VS Code plugin UI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages