buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
android.applicationVariants.all{ variant ->
variant.outputs.each{ output ->
def outputFile=output.outputFile
if(outputFile !=null &&outputFile.name.endsWith(".apk"))
{
//defaultConfig.versionCode是apk版本号
def filename="apk名字${defaultConfig.versionCode}.apk."
output.outputFile=new File(outputFile.parent,filename)
}
}
}
}
}
网站标题:AndroidStudio2.0指定输出apk名字版本号
链接分享:
http://cdweb.net/article/ihophd.html