aua_hot_swap
Push code and resource edits into a running debuggable Android app without reinstalling or restarting, compiling changed classes in place and falling back to a full build when needed.
Instructions
For developing an Android app whose source is on this computer: after editing its code or resources, push the edits into the running debuggable app in about a second, without reinstalling or restarting it. project is the absolute path of a Gradle root or module directory (auto-detected; settings go to build/, project files stay untouched), or of a directory with a hotswap.json. action=swap (default) compiles what changed and redefines the classes in place; Compose recomposes with remembered state, View screens are rebuilt with scroll position and input text kept. It falls back to a full build, install and launch when needed (first call, app not running, manifest/build file change, refused swap): result is swapped, installed or unchanged, with reason for a fallback. The first call can take minutes (Gradle). action=build forces the full build; action=status reports the host toolchain, pending edits and what the next swap would do, changing nothing. A compile error returns compile_failed with compiler output and leaves the app as it was: fix the source and call again. observe returns the screen after the swap in the same call; verified=false: check the UI yourself. Needs a JDK and the Android SDK (NDK once per device ABI). Debuggable builds only; module/variant default to :app/Debug.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>"
},
"name": "aua_hot_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | swap | |
| module | No | ||
| observe | No | none | |
| project | Yes | ||
| refresh | No | auto | |
| variant | No |