android ant 打包须知
来源:互联网 发布:dw cs6连接数据库 编辑:程序博客网 时间:2024/05/29 04:56
1.最近项目上线需要用到ant,有些问题。
2.
首先去下载一个ant ,然后在环境变量里配置 ant_home类似java_home,然后在cmd下输入ant ,如果提示 build.xml not exist 说明安装成功了
然后cd到项目目录下,然后ant deploy 命令
custom_rules.xml里的内容
3.
<?xml version="1.0" encoding="UTF-8"?><project name="custom_rules"><taskdef resource="net/sf/antcontrib/antcontrib.properties"><classpath><pathelement location="ant-libs/ant-contrib-1.0b3.jar" /></classpath></taskdef><target name="deploy"><foreach delimiter="," list="${market_channels}" param="channel"target="modify_manifest"></foreach></target><target name="modify_manifest"><replaceregexp byline="false" encoding="UTF-8" flags="g"><regexppattern="android:name="UMENG_CHANNEL"([\w\W]*)android:value="(.*)"" /><substitutionexpression="android:name="UMENG_CHANNEL" android:value="${channel}"" /><fileset dir="" includes="AndroidManifest.xml" /></replaceregexp><property name="out.final.file"location="${apk.dir}/${app_name}${app_version}@${channel}.apk" /><antcall target="clean" /><antcall target="release" /><antcall target="clean" /></target></project>
代码如下:
<import
file="custom_rules.xml"
optional="true" />
里面
ant-contrib-1.0b3.jar需要是第三方的,如果没有的话,可能会导致ant deploy会错,jar包是负责循环打包的
还有一个 local_properties里定义了一些如下属性,这些地址分别在custom_rules.xml和jar包里被用到,包括找到安卓反编译等需要用到的tool,都在一下地址中
sdk.dir=F:\\andorid_home\\adt-bundle-windows-x86_64-20140702\\sdk
sdk.platformtools=F:\andorid_home\adt-bundle-windows-x86_64-20140702\sdk\\platform-tools
sdk.tools=F:\andorid_home\adt-bundle-windows-x86_64-20140702\sdk\\tools
apk.dir="最后输出包的路径,必须先建好,不然会报zipalign无法打开某压缩包,这个蛋疼"
app_version=1.0
app_name="项目名字,这个和buind里的project节点的name应该一致"
market_channels=official,baidu,tencent,qihoo,wandoujia,google,anzhi,xiaomi,huawei,appchina,sougou,pp,oppo,youyi,woshop,meizu,leshop,yidong,vivo,nduo,9200,gfan,xxzx
key.store="keystore的路径"
key.store.password=123456
key.alias=xxx
key.alias.password=123456
market_channels为渠道号
- android ant 打包须知
- 【ant】ANT打包Android应用
- Android打包之Ant打包
- android ant 打包
- Android 项目 ANT 打包
- Ant 打包 Android 应用
- Android Jenkins ant 打包
- android ant 打包
- ANDROID ANT打包
- ant 打包android应用
- Android Ant打包笔记
- ant 打包android应用
- Android Ant 多渠道打包
- android ant批量打包
- Android多渠道Ant打包
- Android程序ant打包
- android ant 批量打包
- ant 打包android项目
- Java Web应用中调优线程池的重要性
- Vim编辑快捷键
- UI控件笔记(八):UI之UISlider\UIStepper\ UIProgressView\ UITextView\UISwitch\ UIActivityIndicatorView\ UISeg
- 整理iOS工作学习过程中遇到的各种问题
- Faster RCNN anchor_target_layer.py
- android ant 打包须知
- C++封装
- [疯狂Java]JDK:CLASSPATH、java、javac、jar
- 【bzoj4547】【小奇的集合】【矩阵乘法】
- PR/FR/RR/CR各是什么
- 度量快速开发平台分页构建介绍
- datagridview中DataGridViewComboBoxColumn值的比较与选择触发的事件
- Python中 sys.argv 用法
- 检验身份证号码的合法性