Instant run comes with the latest version of Android Studio. But in some cases it is wired when using that.
What is Instant Run?
In an ordinary build and run the whole APK file is updated and pushed to the device. But when using instant run only the updated part gets replaced in the device. Instant Run pushes updated code and resources to your connected device or emulator by performing a hot swap, warm swap, or cold swap. It automatically determines the type of swap to perform based on the type of change you made.
Pros
It may be faster than an ordinary build. But it requires the application to be running at the time of build below API 21.
Cons
Seriously I felt a problem of the unchanged installation. That is when using instant run at some times the application seems to not updating. It is staying at its previous build. And sometimes I felt it was slower than an ordinary build.
Hot swap:
This is the fastest type of swap and makes changes visible much more quickly. Your application keeps running and a stub method with the new implementation is used the next time the method is called.
Warm Swap:
This swap is still very fast, but Instant Run must restart the current activity when it pushes the changed resources to your app.
Cold swap (API level 21 or higher):
This swap is a bit slower because, although a new APK file is not required, Instant Run must restart the whole app when it pushes structural code changes.
Disabling instant run: File=>Settings=>Build,Execution and
deployment=>Instant Run=>Uncheck enable instant run for hot swap
See this documentation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…