I built an open-source tool to edit Jetpack Compose on-device via AST mutations (No Gradle rebuilds)
Description and use
ComposeBridge enables on‑device Jetpack Compose UI editing by mutating source code via AST, providing visual diffs and OTA Gradle builds, speeding up the development loop.
Problem
Android developers face a slow iteration loop in Jetpack Compose: Live Edit is volatile and full Gradle rebuilds are time‑consuming.
Outcome
ComposeBridge decouples UI tuning from the workstation, enabling permanent, compile‑ready source mutations from a device, with visual diff review and OTA Gradle builds, reducing iteration time from minutes to seconds.
Workflow
- 1. Connect device to host via encrypted tunnel.
- 2. Adjust UI token or modifier on the device UI.
- 3. ComposeBridge daemon receives delta and uses Tree‑sitter to parse Kotlin source.
- 4. Daemon locates the Composable call site and mutates the source file on disk.
- 5. Modified files are buffered and visual diffs are shown on the device.
- 6. User accepts or rolls back changes via the phone UI.
- 7. When ready, trigger a headless Gradle build remotely; progress streams to the phone.
- 8. Compiled APK is pushed and installed OTA.
Evidence
ComposeBridge isn’t just an in‑memory preview swapper. It applies permanent, compile‑ready modifications:
When you adjust a UI token or modifier on your physical device, the operational delta is sent back to your host machine over an encrypted tunnel.
A headless background daemon uses Tree‑sitter to parse the Kotlin source tree, locate the exact Composable call site, and safely mutate the source file directly on disk.
When you’re ready for a full run, trigger a headless Gradle build remotely. The progress is streamed back to your phone, and the compiled APK is pushed and installed over‑the‑air.
- Record date: 2026-10-26T06:11:21.061Z