定制apk名字

android{
    ......
    applicationVariants.all { variant->
        variant.outputs.each { output->
            def oldFile = output.outputFile
            if(variant.buildType.name.equals('release')){
                def releaseApkName = applicationId + '_' + versionName + '_' + variant.productFlavors[0].name + '.apk'
                output.outputFile = new File(oldFile.parent, releaseApkName)
            }
        }
    }
    ......
}

你可能感兴趣的:(定制apk名字)