欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

as android 打包

程序员文章站 2022-03-04 17:20:39
...

 

 

1. build -> Generate Signed APK


as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
 

2. next -》 next 


as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
 

 

 3. 多渠道打包

 <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 {
        // 打测试包
        debug{
            // 显示Log
            buildConfigField "boolean", "DEBUG_ENABLE", "true"
//            versionNameSuffix "-debug"
            minifyEnabled false
            zipAlignEnabled false
            shrinkResources false
            signingConfig signingConfigs.debug
        }

        // 打正式包
        release {
            // 不显示Log
            buildConfigField "boolean", "DEBUG_ENABLE", "false"
            // 启用混淆
            minifyEnabled false
            // Zipalign优化
            zipAlignEnabled true
            // 移除无用的resource文件
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // 签名
            signingConfig signingConfigs.release

            // 修改文件名
            applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def outputFile = output.outputFile
                    if (outputFile != null && outputFile.name.endsWith('.apk')) {
                        // 输出apk名称为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)
                    }
                }
            }
        }
    }

    // 配置渠道包
    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"]
        }
    }

 

 
as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
 

 点击 task


as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
 

 

4. 使用 eclipse 签名 打包 

  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'
        }
    }

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信捐助,加入it技术扣扣群),没钱捧个人场,谢谢各位。


as android  打包
            
    
    博客分类: as asandroidstdioapk打包 as android  打包
            
    
    博客分类: as asandroidstdioapk打包 as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
 
 
 谢谢您的赞助,我会做的更好!

 

 

 

  • as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
  • 大小: 25.2 KB
  • as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
  • 大小: 8.6 KB
  • as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
  • 大小: 57.4 KB
  • as android  打包
            
    
    博客分类: as asandroidstdioapk打包 
  • 大小: 11.7 KB