ad-patch

Hot-swap Android app method bodies via JVMTI with verification and revert.

3|Updated May 10, 2026
One-click install
npx skills add https://github.com/Acendas/android-debugger --skill ad-patch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ad-patch
Source: https://github.com/Acendas/android-debugger/tree/main/skills/ad-patch
Command: npx skills add https://github.com/Acendas/android-debugger --skill ad-patch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables hot-swapping of a running Android app's method bodies using JVMTI, allowing changes to behavior without rebuilding or reinstalling.

Core Features & Use Cases

  • Hot-swap a method body at runtime to modify behavior without a rebuild.
  • Validate changes via an explicit verify_via criterion, ensuring observable success before committing.
  • Revert a swap if verification fails, maintaining safety in live debugging sessions.

Quick Start

Invoke /android-debugger:ad-patch <goal> verify_via: <success criterion> to apply a hot-swap in the running app.

Frequently Asked Questions about ad-patch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I hot-swap a method body in a running Android app without a full rebuild?

Hot-swapping a method body uses a multi-step JVMTI workflow including pre-checks, source lookup, incremental recompilation, and classdiff-based swapping to inject code changes into a running Android process without rebuilding or reinstalling.

Can I revert a hot-swap if the runtime code change verification fails?

Yes, you can revert a hot-swap if verification fails. The workflow supports an explicit verify_via criterion to confirm observable success before committing, automatically reverting the swap to maintain safety in live debugging sessions.

Does the Android hot-swap workflow work with minified builds?

No, the Android hot-swap workflow does not work with minified builds. The automated workflow includes error handling specifically designed to catch unsupported hot-swap scenarios and minified build configurations during the pre-check phase.

How do I verify a successful hot-swap in an Android live debugging session?

You verify a successful hot-swap by providing an explicit verify_via success criterion when invoking the patch. The workflow validates the injected changes against this criterion, ensuring the observable behavior matches expectations before committing the swap.

What is the best way to apply runtime code changes to an Android app using Gradle?

The best way to apply runtime code changes is using an automated hot-swap workflow that leverages Gradle build snapshots and incremental recompilation. This applies edits directly to a running app via JVMTI without triggering a full redeploy.

Why does hot-swapping a method body require incremental recompilation and classdiff?

Incremental recompilation and classdiff are required because hot-swapping needs to identify the exact compiled method body changes. The workflow uses classdiff to compute the swap and applies only the modified class definitions to the running Android process.