What is the major difference between
Run app and Apply changes?
What could be the best scenario to use each?
Thanks.
In Android Studio 3.5 and higher, Apply Changes lets you push code and resource changes to your running app without restarting your app—and, in some cases, without restarting the current activity.
In Android Studio, create an Android Virtual Device (AVD) that the emulator can use to install and run your app. In the toolbar, select your app from the run/debug configurations drop-down menu. From the target device drop-down menu, select the AVD that you want to run your app on. Click Run .
The tool windows give you access to specific tasks like project management, search, version control, and more. You can expand them and collapse them. The status bar displays the status of your project and the IDE itself, as well as any warnings or messages.
"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
Apply Changes button provides a faster workflow for most incremental changes to your app. [...]
You can clickApply Changes to push certain code and resource changes to your running app without building a new APK—and, in some cases, without even restarting the current activity. [...]
Clicking Run (or Debug ) forces a cold swap and an app restart. If you make a change to the app manifest or a resource referenced by the manifest, Android Studio always pushes your changes with a full APK reinstall. [...]
Apply Changes action is available only when you meet the following conditions:
- Build your app using a debug build variant.
- Use Android plugin for Gradle version 2.3.0 or higher.
- Set minSdkVersion to 15 or higher in your app's module-level build.gradle file.
- Deploy your app to a target device running Android 5.0 (API level 21) and higher.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With