2.0 Coming in 2.0: Apply Changes without Studio, a standalone debugger, and a live device viewer for Claude Code.ShadowDroid 2.0 is coming. See what's new →

Android, for AI coding agents

Give your coding agent eyes, hands and a debugger for Android.

ShadowDroid is a CLI that lets Claude Code, Codex, Cursor, Gemini and any shell-capable agent drive, inspect and debug real Android apps, emulators and devices. Every answer is compact JSON with the next step built in.

brew install andriyo/tap/shadowdroid

Works with Claude CodeCodexCursorGeminiany shell

The ShadowDroid: a glossy black droid starfighter with a red sensor slash
~65mswarm ui dump, parsed JSON, end to end
48%faster than adb + the android CLI in a 21-task agent benchmark
34%fewer tokens on the same tasks
~1.5sfrom code edit to pixels with app apply, state kept

The loop

Read. Act and prove. Diagnose.

Three commands cover what an agent does all day on a device. No screenshots to squint at, no logcat spelunking.

Parsed elements with stable selectors and tap points, from a service that is already warm on the device.

zsh
shadowdroid ui dump
{"screen_hash":"c50fd462de4304be","interaction_hash":"i:178f2b73ce0e1447",
 "snapshot_state":"consistent","viewport":{"w":1080,"h":2424},
 "current_app":{"package":"io.github.andriyo.shadowdroid.sample"},
 "element_count":39,
 "elements":[
   {"id":3,"text":"Recover the\nsilent relay.","tap":[336,777]},
   {"id":30,"rid":"nav_mission","tap":[403,2256],"clickable":true,
    "handle":"i:178f2b73ce0e1447/e:3"}]}

Every response ends with machine-readable next_actions. If the app crashed since the last command, the next response carries the parsed crash, so the crash finds the agent.

What your agent gets

An Android expert system, wrapped in a CLI.

ShadowDroid keeps a persistent service on the device and an expertise layer on the host. The agent gets the answer, not raw material to parse.

Act and prove it in one call

Tap, type, swipe and scroll by text, id, description or XPath. --expect-* proves the destination, stale-screen guards refuse to act on a changed screen, and taps on covered elements are refused. Compose and Android TV included.

Failures that explain themselves

A missed selector returns what the screen actually shows and the closest matches. why fuses crash, logs, screen and network into one verdict. log is app-scoped JSON with stack frames mapped to your source.

2.0

A debugger that speaks JSON

Breakpoints, stacks, variables, watches, eval, logpoints and coroutines, over JDWP through adb. No Android Studio needed, including breakpoints in startup code. Method calls only run when you opt in.

2.0

Inside the app, no build changes

The ShadowDroid runtime attaches to any debuggable app for the layout tree, Compose recomposition counts with source locations, and live coroutine dumps. The same mechanism as Studio's Layout Inspector.

The network, observed and shaped

A built-in MITM proxy captures HTTP/2, SSE, streaming bodies and WebSocket frames. Intercept and edit requests in flight, write rewrite rules, inject faults, export HAR or curl, and replay recorded backends.

2.0

Edit to pixels in about two seconds

app apply hot-swaps the classes that changed and recomposes only the composables you edited, keeping app state. When that isn't safe it restarts the activity or reinstalls, and says why.

Parallel by design

Per-device ports, reservations and sessions let several agents work at once on different devices and projects, without stepping on each other.

2.0

A device viewer for Claude Code

Watch the emulator live in Claude Desktop. Point at an element and say what to change, or record your taps and let Claude turn them into a UI test.

Why not just adb?

Built for a live agent loop, not a test suite.

Keep adb, Android Studio and the android CLI for building and deploying, and Espresso for regression suites. ShadowDroid takes over once the app is running.

Instead ofThe gap in an agent loopShadowDroid
uiautomator dumpA new process per read, raw XML on /sdcard to pull and parseWarm, parsed JSON with selectors in ~65 ms
input tapBlind coordinates that break on any layout changeSelector actions with postconditions and stale-screen guards
logcatAn unscoped text firehose with crashes buried in noiseApp-scoped JSON, parsed crashes and ANRs, frames mapped to source
Appium, Maestro, EspressoA server, DSL or compiled tests between the agent and the deviceOne CLI the agent already knows how to call

How it works

A fast host CLI and a persistent device service.

The Rust CLI owns orchestration: act-and-observe fusion, log parsing, crash events, source mapping and recovery. The on-device service answers UI reads and performs actions over loopback HTTP. Host-side evidence keeps working even if the device service is down.

  • The runtime attaches inside debuggable apps on demand
  • The proxy and debugger restore device state when they stop
  • doctor --fix diagnoses and repairs the pipe
Your agent calls the shadowdroid CLI on your computer, which talks to a service and a runtime on the Android device over adb. Your agentClaude Code · Codex · Cursor shell + JSON shadowdroid CLIRust, on your computer watch · log · why MITM proxy JDWP debugger adb Android deviceemulator or USB Device serviceUI tree · actions Your app Runtimelayout · coroutines no build changesdebuggable builds

2.0 Coming next

Everything Android Studio does for a person, for your agent.

Apply Changes, from the CLI

app apply builds incrementally, picks hot swap, activity restart or reinstall, and reports what changed on screen, crashes and logged errors.

Standalone debugger

Every debug verb works without Android Studio. With Studio open, ShadowDroid uses it, including native debugging.

The ShadowDroid runtime

Layout Inspector-class data and coroutine dumps from any debuggable app. The in-app library is no longer needed.

Plugins for Claude Code and Codex

A live device viewer with annotations and tap-to-test recording, plus a lean skill that keeps agents fast and cheap.

Install

One binary. Up in a minute.

You also need Android Platform Tools (adb) on your PATH. On first connect, ShadowDroid installs a version-matched, checksum-verified service on the device.

brew install andriyo/tap/shadowdroid
quickstart
# list devices and emulators
$ shadowdroid devices
# install the device service and verify it
$ shadowdroid connect
# read the screen as JSON
$ shadowdroid ui dump
# act by selector, prove the outcome
$ shadowdroid ui tap --text "Sign in" --expect-text "Welcome"
# when something surprises you
$ shadowdroid why
# teach your agent the loop
$ shadowdroid init

Let your agent see what it built.

Install ShadowDroid, run shadowdroid init, and ask your agent to try the app.