1. build -> Generate Signed APK
2. next -》 next
3. Multi-channel packaging
<meta-data android:name="UMENG_CHANNEL" android:value="${UMENG_CHANNEL_VALUE}" />
signingConfigs { debug { keyAlias 'curiousby' keyPassword '123456' storeFile file('C:\\Users\\cmcc-B100036\\Desktop\\android\\iteyeblog-as\\iteyeblog-as.jks') storePassword '123456' } release { keyAlias 'curiousby' keyPassword '123456' storeFile file('C:\\Users\\cmcc-B100036\\Desktop\\android\\iteyeblog-as\\iteyeblog-as.jks') storePassword '123456' } } buildTypes { // print the test package debug{ // show log buildConfigField "boolean", "DEBUG_ENABLE", "true" // versionNameSuffix "-debug" minifyEnabled false zipAlignEnabled false shrinkResources false signingConfig signingConfigs.debug } // make a formal package release { // don't show log buildConfigField "boolean", "DEBUG_ENABLE", "false" // enable obfuscation minifyEnabled false // Zipalign optimization zipAlignEnabled true // remove useless resource files shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // sign signingConfig signingConfigs.release // modify the file name applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { // The output apk name is IteyeBlog_v1.0_2016-07-31_wandoujia.apk def fileName = "IteyeBlog_${defaultConfig.versionName}_${variant.productFlavors[0].name}.apk" //_${releaseTime()} output.outputFile = new File(outputFile.parent, fileName) } } } } } // configure the channel package productFlavors { MAIN { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "MAIN"] } WANDOUJIA { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "WANDOUJIA"] } BAIDU { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "BAIDU"] } QIHU360 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "QIHU360"] } XIAOMI { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "XIAOMI"] } YINGYONGBAO { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "YINGYONGBAO"] } }
click on task
4. Package with eclipse signature
signingConfigs { debug { keyAlias 'baoyou' keyPassword '123456' storeFile file('C:\\Users\\cmcc-B100036\\Desktop\\android\\android-cmcc-B100036') storePassword '123456' } release { keyAlias 'baoyou' keyPassword '123456' storeFile file('C:\\Users\\cmcc-B100036\\Desktop\\android\\android-cmcc-B100036') storePassword '123456' } }
Donate to developers
Driven by interest, I write 免费
something with joy and sweat. I hope you like my work and can support it at the same time. Of course, if you have money to support a money field (support Alipay and WeChat donations, join the it technology buckle group), but have no money to support a personal field, thank you.
Thank you for your sponsorship, I will do better!