使用AndroidStudio开发工具实现多安装

来源:互联网 发布:小米官网和淘宝旗舰店 编辑:程序博客网 时间:2024/05/16 19:40

在gradle中添加如下代码即可:

 buildTypes {        release {            minifyEnabled false            resValue "string", "app_name", "软件"            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'        }        debug {            resValue "string", "app_name", "软件_测试"            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'            applicationIdSuffix '.ceshi'        }    }

其中 resValue 的作用是在string.xml中生成对应的字段内容,app_name 就是应用名称。

applicationIdSuffix 的作用是给 applicationId 添加后缀,因此可以重复安装。

原创粉丝点击