Difference between Run App (Run App) and Apply changes (Apply changes)

Asked

Viewed 137 times

2

In the toolbar of Android Studio, we have 2 buttons:

  • Run App (Run App)
  • Apply changes (Apply changes)

Botões

What’s the difference between them? And when to use one or the other ?


Update

Does the IDE identify the need to use the "Run App"? That is, when a change is made that the "Apply changes" will not apply, only the "Run App" button will be active ?

  • 3

    Downvoter, tell me your problem with the question so I can improve it " ;]

1 answer

4

Apply Changes: Sends only the changed part of the code, and does not create a new APK and in some cases restarts some activity.

Run App: In this case it restarts the application, updates the manifest, and send another APK.

Source: run app vs apply changes android studio 2.3

Update

Run App

To compile and run your application, click Run . Android Studio compiles your app with Gradle, prompts you select a deployment destination (an emulator or device connected) and deploys your application on it. You can customize some of these default behavior, such as selecting a target for automatic deployment, when changing the run configuration.

Apply Changes

After deploying an app, a small yellow lightning icon will be displayed on Run button (or Debug button ), indicating that Instant Run is ready to send updates the next time you click on button. Instead of compiling a new APK, it sends only these new changes and in some cases the app even needs to be restarted and immediately shows the effect of code changes.

More information from the IDE’s own website: Compile and run your application

The site in English is more updated: Build and Run Your App

  • 1

    In view of the "Run App" would be the last case. I still wonder if it was for a Gradle amendment, or something more specific, but thinking about it now with that piece of your answer " indicando que o Instant Run está pronto para enviar atualizações na próxima vez que você clicar no botão", I was wondering: When I make a change, where I need to recompile, reinstall, the app, I mean, give a "Run App", the "Apply changes" button would be blocked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.