Search code examples
androiddebugginghotswap

Hot swap debugging with Android


1) Is there any special setting/configuration required to enable hot swap debugging on Android?

Example case:

  • Add breakpoint just after entering activity's onCreate method.
  • Add new line on the fly after the breakpoint (dummy "if (1==1) return;" code)
  • Step to next instruction --> Problem: my debugger doesn't break at this line, instead skipping to the next leading me to believe the new line was not hot swapped into the VM.

2) Does only the emulator support hot swap? Are there any handsets which also support it?


Solution

  • The emulator itself doesn't support code hotswap, but with additional tools like InstaReloader desired action can be achieved. You can use this Android hotswapping tool for free