What is the major difference between
Run app and Apply changes?
What could be the best scenario to use each?
Thanks.
What is the major difference between
Run app and Apply changes?
What could be the best scenario to use each?
Thanks.
On
When you click "Run" App icon, it will uninstall existing build and install build every time.
"Apply Changes" option will be available only if you enable "Instant Run" feature in android studio. It will swap changes to existing build and run your build. Your existing build will not get uninstalled when you do this.
On
The Instant Run / Apply Changes feature will try to push your changes without building and deploying a full APK, and if possible without restarting the application or even the current activity. It will resort to a full reinstall if needed. More details here.
Before Android Studio 2.3, the Instant Run feature was available through the Run (or Debug) button, as long as certain conditions were met. Starting with Studio 2.3 we have a dedicated button for Instant Run, which is the Apply Changes button. It is only available when Instant Run is possible. The Run and Debug button now always restart the app.
From the Release Notes:
A separate button to push changes with Instant Run: After deploying your app, you now click Apply Changes to quickly push incremental changes to your running app using Instant Run. The Run and Debug buttons are always available to you when you want to reliably push your changes and force an app restart
"Apply changes" will be enabled if you have "instant run" enabled and to disable instant run check https://stackoverflow.com/a/35169716/2826147
From the Android documentation: https://developer.android.com/studio/run/index.html