Android打包那些事
2016-04-25 15:17
435 查看
出处
Android打包那些事下面是做的一些笔记
多渠道打包"360"{ manifestPlaceholders = [channel:"360"] }
如果渠道名是数字开头,则必须加引号
build-type中的参数
// minifyEnabled 混淆处理 // shrinkResources 去除无用资源 // signingConfig 签名 // proguardFiles 混淆配置 // applicationIdSuffix 增加APP ID的后缀 // debuggable 是否保留调试信息
自定义输出apk名称
android { // rename the apk with the version name // add output file sub folder by build type applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = new File( output.outputFile.parent + "/${variant.buildType.name}", "ganchai-${variant.buildType.name}-${variant.versionName}-${variant.productFlavors[0].name}.apk".toLowerCase()) } } }
额外信息
android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { (类型,名称,方法名) resValue "string","build_time",buildTime() resValue "string","build_host",buildHost() } } def buildTime(){ //获取当前时间 return new Date().format("yyyy-MM-dd HH:mm:ss") } def buildHost(){ //获取当前计算机名称 return System.getProperty("user.name") + "@" + InetAddress.localHost.hostName }
相关文章推荐
- Jenkins Android 自动打包配置
- Android中的内存管理机制以及正确的使用方式
- Android方法记录
- Android中文API-Include标签
- android /Cordova LOG 、console 调试调试打印log
- 【Android】获取手机中已安装apk文件信息(PackageInfo、ResolveInfo)(应用图片、应用名、包名等)
- 关于Activity生命周期的理解 一(直白高效版)
- Android studio 使用技巧以及常用设置
- android自定义view----等分饼图,实现每个块中间的间隔
- Android关于OnTouch 和OnClick同时调用冲突的解决方案
- Android继承现有控件拓展实现自定义控件textView
- Android开发内存泄露之--Handler引起的内存泄露
- Android proguard遇到的若干问题以及解决思路
- ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.AbsLis
- Android POI 百度地图——周边检索
- Android studio Error:Plugin with id 'com.github.dcendents.android-maven' not found
- Android如何保证数据加载下一页确定当前listview的位置
- Android-Charts,Android图形图表控件
- Android保存ArrayList至SharedPreferences
- Android之玩转MPAndroidChart让(折线图、柱形图、饼状图、散列图、雷达图)优雅的舞动