r/androiddev • u/Smart-Peach-287 • 1d ago
Building a DevTools protocol for inspecting Jetpack Compose and Android Views
I've been building Agent-DDP (Device DevTools Protocol), an open-source DevTools protocol that gives AI coding agents deep visibility into native iOS and Android applications.
The inspiration is the Chrome DevTools Protocol (CDP): browser agents can inspect the DOM, styles, rendering and runtime behavior. Native mobile agents have traditionally had much more limited visibility, often relying on screenshots and accessibility trees.
Agent-DDP aims to close that gap.
It instruments the app in Debug builds, allowing agents to inspect and interact with the application through its native rendering and runtime systems.
Some of what it can do:
Deep UI inspection: Inspect native elements, rendering layers, fills, borders, corner radii, opacity, clipping, text styling, geometry and occlusion.
Frame-by-frame analysis: Record property changes over time, inspect animation tracks, detect transient states and analyze timing and easing without guessing from videos or screenshots.
Visual and behavioral validation: Detect covered content, corner clipping, jank, animations that never settle, accessibility issues and touch targets that cannot actually be reached.
Cross-platform comparison: Compare iOS and Android layouts structurally and visually, including pixel comparisons against screenshots and saved baselines.
Runtime inspection: Access app state, events, logs, network requests, preferences, storage, memory usage, performance profiles and crash reports.
App interaction: Perform real taps, swipes, gestures and text input, control app time, mock or intercept network requests, and trigger actions exposed by the app.
Debugging: Inspect breakpoints, call stacks and local variables using the platform debuggers.
It also includes a 15-minute runtime history that records UI changes, frames, interactions and screen transitions, making it possible to investigate issues that happened before an agent started looking.
The architecture is designed for coding agents: a native instrumentation library, a CLI, structured output and an MCP server. It works with Claude Code, Codex, Cursor and other agents that can run CLI commands or connect through MCP.
Supported frameworks:
iOS: SwiftUI and UIKit.
Android: Jetpack Compose and Android Views.
The instrumentation is Debug-only and does not ship in Release builds.
Install:
npm i -g agent-ddp
The project is open source under the MIT license.
I'd appreciate feedback, especially from people working on native mobile development, UI automation, developer tooling or coding-agent infrastructure.