您的位置:首页 > 移动开发 > Android开发

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

2017-10-09 14:32 330 查看
在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 添加后缀,因此可以重复安装。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: