Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run app vs apply changes android studio 2.3

Tags:

What is the major difference between

Run app and Apply changes?

enter image description here

What could be the best scenario to use each?

Thanks.

like image 278
Prabs Avatar asked Apr 19 '17 06:04

Prabs


People also ask

What is apply changes in Android Studio?

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.

How do you run a program on android?

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 .

Where will the status of building and running the project is shown in the Android Studio IDE?

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.


1 Answers

"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.
like image 66
Amit Vaghela Avatar answered Oct 08 '22 02:10

Amit Vaghela