很多时候软件调试需要测试包和正式包,那么如何在同一设备上安装不同版本的软件呢?
关键先生登场:applicationIdSuffix 就是这货!
在app 中build.gradle 的打包配置里面增加 applicationIdSuffix
如下:
buildTypes {
debug {
applicationIdSuffix ".debug"
}
release {
minifyEnabled false
}
}
只需要在debug中增加applicationIdSuffix ".debug",后续在打包过程中选择debug 和 release 会生产不同的包名!
release 不需要加,保持原包名即可,只需要两者包名区分即可安装!