How to automatically uninstall android app from device before installing a new version(如何在安装新版本之前从设备上自动卸载 android 应用)
问题描述
我正在使用带有 Gradle 构建的 Android Studio.我在设备上测试我的应用程序,让 Android Studio 和 Gradle 构建应用程序并将其安装在设备上.如何让 Gradle 或 Android Studio 在安装新版本之前从设备上卸载该应用?
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 or Android Studio to uninstall the app from the device before installing a new version?
推荐答案
显然,如果你在 Run ->编辑配置...,左侧有一个可消耗的 Android 配置列表.
Apparently, if you in Run -> Edit Configurations..., on the left side there is a expendable list of Android configurations.
选择你的,窗口右侧是配置的详细信息,该部分的底部是Before launch部分.
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.
创建一个 gradle-aware Make,给定任务 :app:uninstallAll 或 :app:uninstallDebug 哪个适合你.(有自动完成功能来获取所有可用的任务,app 如果您有多个模块,可能会有所不同).
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).
这篇关于如何在安装新版本之前从设备上自动卸载 android 应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在安装新版本之前从设备上自动卸载 androi
基础教程推荐
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
