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

后端 未结 2 1869
清酒与你
清酒与你 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:57

    The current answer is a little outdated, these are the simplest steps:

    • Select Edit Configurations from the dropwdown
    • Find the section Before Launch: Gradle task, Gradle-aware Make
    • Click + and choose Run Gradle task
    • In the Gradle project field, select the root of your project
    • In the Tasks field enter :app:uninstallAll or equivalent
    • Leave the other fields blank and press OK
    • Reorder the tasks so your new one is first / top of the list

提交回复
热议问题