Skip to content

release: v0.8.0 hot swap for apps under development - #5

Merged
JackCaow merged 3 commits into
mainfrom
feat/hot-swap
Nov 10, 2026
Merged

JackCaow merged 3 commits into
mainfrom
feat/hot-swap

Conversation

@JackCaow

Copy link
Copy Markdown
Collaborator

Summary

Adds aua_hot_swap, which pushes source edits into a running debuggable app without reinstalling or restarting it, and prepares v0.8.0.

  • Engine in src/android_use/hotswap (standard library only): compile changed files, diff class bytes, redefine in place through a JVMTI agent; resources relinked with stable IDs.
  • UI state kept: Compose remembered state and scroll; View scroll offsets, typed text, keyboard.
  • Gradle projects detected from the root or a module directory, no setup; fallback to a full build when a swap is not possible; compile errors reported with the app untouched.
  • script/hotswap: command line, two lab apps and the on-device suite.
  • Docs: docs/hot-swap.md, README sections, guide tables, skill. Version sources bumped to 0.8.0 with release notes.

Validation

  • 478 Python tests pass locally (the 19 installation tests need network and run in CI); Ruff clean; release check passes for v0.8.0.
  • Physical phone (Android 16), real MCP stdio session: one-line Java edit swapped in 0.55–0.64 s, new text present in the returned tree.
  • script/hotswap/verify.py on the phone: plain app 22/22. The Compose sample passed all its checks in the preceding run and was not repeated after a test-only fix.
  • Not exercised: Gradle auto-detection on a device (unit tests only), Windows hosts, the standalone runtime build, kapt/KSP/Hilt/Room, multi-module Gradle, Kotlin 2.x.

Hot swap
- Add aua_hot_swap: compile edited sources, diff class bytes against what
  the process runs, and redefine them in place through a JVMTI agent.
  Resources are relinked with stable IDs and loaded into the process.
- Keep UI state: Compose recomposes over its existing state; View
  activities are rebuilt with scroll offsets, typed text and the keyboard.
- Detect Gradle projects from the root or a module directory; settings
  and caches stay in the project's build/ directory.
- Fall back to a full build, install and launch when a swap is not
  possible, and report compile errors without touching the app.
- status reports the host toolchain and what the next call would do.
  A paused device refuses swap and build.
- The engine lives in src/android_use/hotswap and uses only the standard
  library; script/hotswap holds the command line, lab apps and the
  on-device suite.

Docs: docs/hot-swap.md, README sections, guide tool tables and the skill.
Bump every version source to 0.8.0 and add release notes.
The fixture replaced every occurrence of the current version in uv.lock,
which also rewrote a locked dependency that happens to share 0.8.0.
@JackCaow
JackCaow merged commit c6107d7 into main Nov 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant