我正在使用带有 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 应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)