r/androiddev • • 2d ago

Android ADB Skill: let AI coding agents drive an Android device or emulator, no MCP server needed

I made a small open-source toolkit that lets AI coding agents (Claude Code, Codex, Cursor, Copilot and others) control an Android device or emulator through adb.

It has two parts: - ./tools/android, a single Python script with a stable command set: screenshots, UI hierarchy dumps, finding and tapping elements, swipes and scrolls, waiting for an element, installing and launching APKs, and reading logcat. Every command supports --json, so the agent gets structured output instead of parsing free text. - Short skill files for common tasks like navigating to a screen, running a test flow, or debugging a crash. They call the script instead of raw adb.

Why not an MCP server? I started with one and found that the useful part was the command design, not the server. A plain script has no extra process to run, keeps adb details like device selection, text escaping and UI parsing in one place, and is easy to test. The test suite uses a fake adb, so CI doesn't need a device.

Example prompts: /android open Settings and navigate to Privacy /android-test log in with user@example.com and verify the home screen /android-debug crashes in com.example.app after tapping Settings

To set it up, copy the tools, skills and docs folders into your app's repo, plus the instructions file for your agent. You need adb and python3. MIT licensed.

https://github.com/amit-nayar/android-adb-skill

Feedback and PRs welcome, especially from people using it in a real build, install and verify loop.

0 Upvotes

9 comments sorted by

4

u/bleeding182 2d ago

I was expecting some random, low-quality repo with 500+ lines SKILLs in it, but I was pleasantly surprised. This actually seems sensible.

For anyone wondering: No, you don't need this or any similar skills. Current Models are good enough to do all of this on their own already, without skills or similar. This is a neat package that might optimize/streamline things, though.

I would still aggregate the skills into a single, bigger one, since an agent needing one of those skills usually needs some of the others as well. Your wording is already very compact, so an aggregate skill might actually save more tokens by avoiding individual skill descriptions and overheads.

1

u/incredulouspig 17h ago

Interesting, thanks, I'll take a look at this

14

u/B3nedikt 2d ago

I am still not convinced that these skills actually make claude better with adb.
Is it really working better for you then just have claude use adb without a skill?

2

u/FylanDeldman 2d ago

IMO it only pays off if you are using it for recording commands specific to your code base - like a bunch of intents / broadcast receiver information, or like a particular deep link launch or something. But tbh unless you have a ton of those they can typically be just in the README or some other doc or whatever.

1

u/FFevo 2d ago

The vast majority of models probably wont need a skill to do this, but using one will probably be far more token efficient.

I would recommend using the official one from Google instead though.

1

u/bleeding182 2d ago

Try with the model / harness / setup you usually use. Add the skill(s), try again. (Ask your agent to) analyze the logs / steps the agents took and see if it made more/less errors.

See my comment above: For the current, good models (e.g. Opus 5.5) it largely won't be necessary, especially for a one-off. But if you routinely have your agent drive an emulator it might streamline things.

Looking at my own past sessions where I had Opus drive an emulator, multiple sessions ended up writing a throwaway ui automator script to help with one thing or another around dumping the UI and tapping the corresponding location.
So instead of every agent reinventing how to do certain things on their own, a specialized skill would likely help. (The same applies to any other parts of your workflow, ofc)

1

u/ohaiibuzzle 1d ago

I have no idea why you would need this, 99% of the time I just say "there's a device over adb" and the model just go with it.