How do I uninstall and re-run an app on a device using Android Studio?

前端 未结 4 1014
别跟我提以往
别跟我提以往 2020-12-14 09:54

I am new to Android Studio and I feel that I must be doing something wrong. When running MyApp on an actual device the process goes like this.

  • Edit code.
相关标签:
4条回答
  • 2020-12-14 10:26

    You can skip the force stop and uninstall step by just hitting run again. Android Studio should prompt you which device to run on and there you can select your connected device.

    It will close the app and re-run your changed version.

    0 讨论(0)
  • 2020-12-14 10:27

    I think this answer is what you're looking for. Basically edit your configuration to perform an uninstall before app launch.

    From the Run menu -> Edit Configurations... -> Before Launch -> Add Gradle-aware Make -> ":app:uninstallAll"

    0 讨论(0)
  • 2020-12-14 10:34

    I always just hit the "debug" icon (the bug icon) and from the debug tab (at the bottom of your screen), you can stop running the app by clicking on the stop button. No need to uninstall/reinstall app. When you're done, you can do a release build of the apk.

    0 讨论(0)
  • 2020-12-14 10:41

    You can execute the gradle task :app:uninstallAll to uninstall the app. The next time you hit Run your app will be reinstalled.

    0 讨论(0)
提交回复
热议问题