如何在打安装包的时候自定义apk名字
2020-07-27 本文已影响0人
ButICare_b72d
在项目App.gradle目录下加入以下代码
android{
//..................
android.applicationVariants.all{ variant->
variant.outputs.all{
def date =new Date().format("yyyy-MM-dd HH时mm分ss" , TimeZone.getTimeZone("GMT+08"))
if(variant.buildType.name.equals('debug')){
outputFileName ="才士网校debug_${date}.apk"
}else{
outputFileName ="才士网校release_${date}.apk"
}
}
//.....................
}