2026-11-26 15:47 UTC

DroidPath offers graph-routed Android automation through accessibility UI state

state: watchingheat: lowuncertainty: highrelevance: mediumandroid-automation ui-trees agent-hardwareKirill Zaitsev

What is this?

DroidPath is a MIT-licensed Android automation project by maintainer Kirill Zaitsev, available via GitHub and described as supporting macOS 14+ hosts. Its README says a Kotlin daemon streams accessibility- and window-derived UI state, while a persistent graph and A* router navigate screen workflows through an MCP bridge. The README reports a Pixel 10a example reaching “Night Light” in 1,683 ms over four hops without intermediate LLM calls, versus 4–5 vision calls and about 12–25 seconds for a traditional screenshot loop. Those figures are maintainer-provided, not independently verified. A later HN post links to a benchmark document claiming 0.32 ms UI trees, but the supplied evidence does not include that document’s contents, so the claim’s meaning and methodology are unclear.

Why it matters

DroidPath illustrates a practical alternative to screenshot-driven mobile agents: use Android’s structured accessibility state and a learned screen graph to make routine navigation faster and avoid repeated vision-model calls. If robust across apps and changing UI states, this could lower latency and inference costs and make agentic phone control more practical. Evidence here establishes an available project and its design, not broad reliability or independently validated speed gains.

Current assessment

Newer evidence: an HN post dated Nov. 23, 2026 links to DroidPath’s benchmark document and frames it as reporting 0.32 ms Android UI trees and A* routing. The supplied source record does not contain the benchmark itself; treat this as an attributed pointer, not verified performance evidence. Baseline: the project README, fetched Nov. 16, describes a live accessibility/window-derived UI tree, persistent spatial graph, A* workflow routing, Android daemon, MCP tools, and MIT license. It says the tool is downloadable from GitHub Releases and gives a maintainer-run Pixel 10a comparison (1,683 ms for four hops; zero intermediate LLM calls, against 4–5 vision calls and 12–25 seconds). This supports reporting the release and architecture, but not generalizing its benchmark to other devices, apps, or tasks. Accessibility-derived state can offer agents a more structured and potentially cheaper control surface than repeated screenshot interpretation; graph-based routing may also reuse known paths. Open questions include app/device coverage, handling inaccessible or dynamic interfaces, robustness, security implications of device control, and independent validation. The supplied web results add no DroidPath-specific corroboration or adoption evidence.

Measured heat

now 0 pts/hpeak 11 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 254h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-16 01:23 (minted)⭐ origin echo-reconstructedThe GitHub repository is the origin artifact: its README describes DroidPath as a system that streams a live Shadow DOM from Android accessi
Kirill Zaitsev on github (echo) · attributed from hn.story.50512794 · published time unknown
—
11-16 01:08first on hacker news · published · lag ?DroidPath – Stream Android UI Trees at 60Hz over TCP (Bypassing ADB)
Ak4shik
—
11-16 01:08amplified on hacker newshn.story.50512794
Ak4shik
peak 1 · 0 comments · 34% of case engagement
11-22 15:19amplified on hacker news 👑hn.story.50600460
Ak4shik
peak 1 · 1 comments · 69% of case engagement
11-16 01:20our radar first saw it · lag ?discovery anchor: hn.story.50512794—
pace: p29 vs 2096 stories at the 168h mark (now 254h old) — ahead of adap-delegated-authority-protocol-draft (2.0x), behind abmaze-protein-fitness-agent-benchmark (0.7x)

Evidence (3) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnDroidPath – Stream Android UI Trees at 60Hz over TCP (Bypassing ADB)
Retrieved article excerpt

Open article · Retrieved 2026-11-16T01:21:28.833966+00:00

# DroidPath

**Persistent A\* Symbolic UI Router, Headless Kotlin Shadow DOM Daemon & Standalone MCP Bridge for Android**

[License: MIT](https://github.com/V0val0x/DroidPath/blob/main/LICENSE)
[Platform: macOS 14+ / Android](https://github.com/V0val0x/DroidPath)
[GitHub Release](https://github.com/V0val0x/DroidPath/releases)
[CI](https://github.com/V0val0x/DroidPath/actions/workflows/ci.yml)

**English** | [Русская версия (Russian)](https://github.com/V0val0x/DroidPath/blob/main/README_RU.md)

[DroidPath Persistent A\* Symbolic UI Router Demo](https://github.com/V0val0x/DroidPath/blob/main/assets/demo-droidpath-presentation.gif)

**DroidPath** eliminates slow, token-heavy VLM screenshot-think-tap loops for Android automation. Instead of asking an LLM to inspect screenshots at every step, DroidPath streams a live **Shadow DOM** directly from Android Accessibility & Window APIs, compiles UI transitions into a **persistent Spatial Graph**, and navigates multi-screen workflows deterministically with **A\* pathfinding** in sub-second hops — with **zero intermediate LLM roundtrips**.

---

## Architecture (3 Layers)

```
flowchart LR
    Agent["AI Agent (Claude / Cursor / MCP Client)"] <-->|"JSON-RPC 2.0 (stdio / HTTP+SSE)"| CLI["droidpath-mcp / DroidPathBridge"]

    subgraph Host["macOS Host (Swift 5.9+ · AndroidShadowGraphKit)"]
        CLI <-->|"Path Queries & Passive Learning"| Bridge["ShadowGraphBridge"]
        Bridge --> DOM["ShadowDOMState + ShadowTreeIndex"]
        Bridge --> Graph["SpatialGraphEngine\nScreenLayoutHasher · Jaccard ≥ 0.90\n~/.droidpath/shadow_graph.json"]
        Bridge --> AStar["AStarPathfinder + MacroExecutionEngine"]
        Bridge -->|"Self-Healing Recovery Hook"| Recovery["SHA-256 Deploy + app_process Restart"]
    end

    subgraph Android["Android Device (Zero-APK)"]
        Daemon["android-daemon.jar (Kotlin single-DEX)\napp_process :27189 · NDJSON Delta Stream"]
        Sys["UiAutomation / Accessibility / WindowManager"]
    end

    Daemon <-->|"adb forward tcp:27189"| DOM
    AStar -->|"adb shell input tap/swipe"| Sys
    Daemon --- Sys
```

 Loading

1. **Layer 1 — Headless Kotlin Shadow DOM Daemon (`android-daemon/`):**

   - Compiles into a standalone **631 KB single-DEX JAR** (`android-daemon.jar`) launched via `app_process` — zero companion APK install required.
   - Streams full snapshots and compact NDJSON incremental diffs over TCP (`:27189`) with event debouncing, configurable tree depth, and heartbeat/watchdog protection.
   - Deployed idempotently via SHA-256 verification (`DroidPathManager` / `deploy.sh`) and protected by automatic self-healing recovery if Android kills the process.
2. **Layer 2 — Live Shadow DOM & Persistent Spatial Graph (`AndroidShadowGraphKit`):**

   - `ScreenLayoutHasher` strips volatile timestamps, clocks (`12:34`), and dates so returning to Home or Settings hashes deterministically.
   - `SpatialGraphEngine` constructs a directed multigraph of screens (`vertices`) and UI gestures (`edges`), automatically compacts near-duplicate screens via Jaccard similarity (`>= 0.90`), and persists to `~/.droidpath/shadow_graph.json`.
3. **Layer 3 — Persistent A\* Symbolic Router & Standalone MCP Bridge (`DroidPathBridge` + `droidpath-mcp`):**

   - `AStarPathfinder` + `BinaryHeapPriorityQueue` computes minimum-cost multi-hop routes to any target text, `resource-id`, package, or canonical layout hash.
   - `MacroExecutionEngine` dispatches each tap/swipe over ADB, waits for exact or canonical Shadow DOM confirmation per hop (including post-swipe `RecyclerView` fling quiescence before resolving downstream bounds), and raises structured `PathDeviationError` diagnostics on unexpected popups or screen timeouts.

---

## Live Benchmark (Pixel 10a · `android_navigate_to_node`)

Prompt: *"Navigate to Night Light"* from Launcher Home Screen:

| Metric | Traditional VLM Screenshot Loop | **DroidPath A\* Router** |
| --- | --- | --- |
| **Intermediate LLM Roundtrips** | 4–5 vision inference calls | **0 calls** |
| **Total End-to-End Latency** | ~12,000–25,000 ms | **1,683 ms** (4 hops) |
| **State Feedback** | Full PNG screenshots (`screencap`) | Sub-ms Shadow DOM NDJSON frames |



| Standalone Agentic HUD Execution |
| --- |
| [Layer 3 Agentic HUD](https://github.com/V0val0x/DroidPath/blob/main/assets/demo-layer3-agentic-hud.gif) |



---

## Quick Start

### 1. Build `droidpath-mcp` & `android-daemon.jar`

Prerequisites: macOS 14+, Swift 5.9+, `adb` (`brew install android-platform-tools`), JDK 17 (only needed if rebuilding `android-daemon.jar` from Kotlin source).

```
git clone https://github.com/V0val0x/DroidPath.git
cd DroidPath

# Build standalone single-DEX Kotlin daemon (requires JDK 17 + Android d8 / build-tools or Gradle)
./android-daemon/scripts/build-dex.sh

# Run Swift + Kotlin tests
swift test
./android-daemon/gradlew -p android-daemon test

# Build release CLI
swift build -c release
```

Or download prebuilt `droidpath-mcp` and `android-daemon.jar` directly from [**GitHub Releases**](https://github.com/V0val0x/DroidPath/releases).

### 2. Configure Claude Desktop / Cursor (`stdio`)

```
{
  "mcpServers": {
    "droidpath": {
      "command": "/path/to/droidpath-mcp",
      "args": ["--stdio", "--daemon-jar", "/path/to/android-daemon.jar"]
    }
  }
}
```

Or launch the loopback HTTP/SSE MCP server (`127.0.0.1:8766`):

```
droidpath-mcp --http --port 8766 --daemon-jar ./android-daemon/build/dist/android-daemon.jar
```

### 3. Use `AndroidShadowGraphKit` in Swift Package Manager

```
dependencies: [
    .package(url: "https://github.com/V0val0x/DroidPath.git", from: "1.0.0")
]
```

Add `"AndroidShadowGraphKit"` (core Shadow DOM, Spatial Graph, and A\* engine) or `"DroidPathBridge"` (ADB deployer, persistence, and MCP core) to your target dependencies.

---

## Exposed MCP Tools

| Tool | Description |
| --- | --- |
| `android_navigate_to_node` | Runs Layer 3 A\* routing to reach a target text, `resource-id`, package, or canonical layout hash (`0x...`) across screens |
| `android_get_ui_tree` | Reads live interactive UI elements from the Kotlin Shadow DOM stream (with `uiautomator` XML fallback) |
| `android_graph_stats` | Inspects persisted graph vertex/edge counts, active canonical hash, daemon state, and storage path |
| `android_list_devices` | Lists connected USB and Wireless ADB Android devices |
| `android_tap_element` | Taps by `(x, y)` or semantic `text` / `resource_id` / `content_desc` and records the graph edge |
| `android_swipe` | Swipes `(x1, y1) -> (x2, y2)` and attributes the gesture into the Spatial Graph |
| `android_type_text` | Types text into the active Android field |
| `android_keyevent` | Sends Android keyevents (`HOME`, `BACK`, `ENTER`, `APP_SWITCH`, `POWER`) |



---

## Modular Open-Source Ecosystem

Part of the native macOS ↔ Android automation suite alongside [**AndOnMac**](https://github.com/V0val0x/AndOnMac):

- [**AndOnMac**](https://github.com/V0val0x/AndOnMac) — Native 120Hz ProMotion Metal Android mirroring & control app with built-in DroidPath Agentic HUD
- [**AndroidMCPKit**](https://github.com/V0val0x/AndroidMCPKit) — Visual-to-MCP `{{parameter}}` macro studio & 3-tier Apple Vision OCR self-healing
- [**MetalScrcpyKit**](https://github.com/V0val0x/MetalScrcpyKit) — Zero-copy VideoToolbox H.264/HEVC decoder & `CAMetalLayer` renderer
- [**ADBConnectKit**](https://github.com/V0val0x/ADBConnectKit) — Zero-dependency Swift ADB SDK (USB, QR Wi-Fi pairing, Direct Hotspot bypass)
- [**VisionScreenRecallKit**](https://github.com/V0val0x/VisionScreenRecallKit) — Apple Silicon Vision OCR & SQLite FTS5 screen memory

---

## License

MIT License © 2026 Kirill Zaitsev. See [LICENSE](https://github.com/V0val0x/DroidPath/blob/main/LICENSE).
Ak4shik10
🟧 echo.github ⭐The GitHub repository is the origin artifact: its README describes DroidPath as a system that streams a live Shadow DOM from Android accessiKirill Zaitsev——
🟧 hnBypassing ADB: 0.32ms Android UI trees and A* routing for AI agents (Rust/KotlinAk4shik11

Interpretation history

Decision trace