android - 同时安装稳定版和开发版应用程序的实用方法是什么?

标签 android build android-studio installation android-gradle-plugin

我想在我的手机上保留我的应用程序的稳定版本,并继续开发...如果有切实可行的方法,这将使该应用程序在手机上运行两次。

搜索导致一些人做了我已经考虑过的事情:重构包名称,并且可能使用不同的图标文件。这有点不方便,容易做错事或忘记等。

使用 Android Studio,人们是否可以在 build.gradle 文件或其他配置文件中做一些奇特的事情来轻松完成这项工作?

编辑---

因此,根据下面的建议,我将以下 block 添加到 build.gradle 中,位于“defaultConfig” block 之上。

buildTypes {
    debug {
        versionNameSuffix ".DB"
        applicationIdSuffix ".debug"
    }
}

就使用不同的图标来区分构建而言,目前,我已将一个 72x72 图标变体添加到 res/drawable-hdpi 文件夹中。我的 list 文件中有两个图标名称的注释。我只需复制并粘贴到 android:icon 行,即可更改图标。

最佳答案

您可以添加到您的 buildTypes{}

 debug {
        versionNameSuffix "-DEBUG"
        applicationIdSuffix ".debug"
    }

关于android - 同时安装稳定版和开发版应用程序的实用方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27697691/

相关文章:

android-studio - C 中的 .AndroidStudio2.1 和 .AndroidStudio2.2 文件夹

java - 从智能手机捕获指纹并保存到文件

android - 如何在最新的 Android 7.1 Nougat 中实现图像和 Gif 键盘

android - 如何安全地关闭 onstop() 中的 DialogFragment?

安卓工作室 : GC overhead limit exceeded

android - 错误 :duplicate files during packaging of APK

从源代码编译 gtk

Android 开发者控制台显示支持的设备为零

c++ - 在发布版本中保留调试符号有缺点吗?

android - 无法在 Android Studio 中安装 LLDB 和 Cmake