How to automatically uninstall android app from device before installing a new version

后端 未结 2 1872
清酒与你
清酒与你 2020-11-29 03:00

I am using Android studio with Gradle builds. I test my app on a device and let Android Studio and Gradle build the app and install it on the device. How can I tell Gradle o

2条回答
  •  不知归路
    2020-11-29 03:53

    Apparently, if you in Run -> Edit Configurations..., on the left side there is a expendable list of Android configurations.

    Select yours, on the right side of the window are details on the configuration, at the bottom of that section is the Before launch section.

    Create a gradle-aware Make, given the task :app:uninstallAll or :app:uninstallDebug whichever suits you. (There is autocompletion to get all the available tasks, app may vary if you have several modules).

提交回复
热议问题