在用AS 进行打包时,做到修改输出的APP包名
在app/build.gradle文件下修改
buildTypes{
debug{
minifyEnabledfalse
}
release{
debuggablefalse
minifyEnabledfalse
shrinkResourcesfalse
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
applicationVariants.all{ variant->
variant.outputs.all{ output->
def date =new Date().format("yyyy_MM_dd", TimeZone.getTimeZone("GMT+08"))
if (variant.buildType.name =="debug") {
output.outputFileName="${date}_v${android.defaultConfig.versionName}.apk"
}else if (variant.buildType.name =="release") {
output.outputFileName ="release_${android.defaultConfig.versionName}.apk"
}
}
}
}
}