There are three types of code swaps that Instant run enables to support faster debugging and running app from your code in Android Studio.

When are each of these swaps triggered?

HOT SWAP is triggered when an existing method’s implementation is changed.

WARM SWAP is triggered when an existing resource is changed or removed (anything in the res folder)

COLD SWAP whenever there is a structural code change in your app’s code e.g.

  1. Add, remove, or change:
  1. Change which parent class the current class inherits from
  2. Change the list of implemented interfaces
  3. Change a class’s static initializer
  4. Reorder layout elements that use dynamic resource IDs

What happens when a code swap happens?

HOT SWAP changes are visible instantly - as soon as the next call to the method whose implementation is changed is made.