Android ant 搭建,配置,执行

一、下载ANT

ant 官网可下载 http://ant.apache.org/

ant 环境配置: 
1。解压ant的包到本地目录。 

2。在系统环境变量中设置ANT_HOME,值为你的安装目录。


3。把ANT_HOME/bin加到你系统环境的path


4.可能需要重启系统,执行一下,ant -version


二、详细使用

1.生成一个android project

用eclipse或者android命令都行

2.

对已经存在的android工程,我们可以update下,这样会自动添加build.xml 等ant 的配置文件
C:\Documents and Settings\Administrator>android update project --target android-17  --path E:\work\android_workspace\HaifeiAccumulation
可以自己查一下帮助文档android update project -h 

3.

3.1执行C:\Documents and Settings\Administrator>ant debug 生成debug apk。这里签名用的是系统的

3.2执行 C:\Documents and Settings\Administrator>ant release 生成release apk。这样生成的apk是没有签名的

配置文件ant.properties

a.在本地工程下生成一个文件ant.properties  

b.内容为

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note

key.store=签名文件
key.alias=签名的alias
key.alias.password=密码
key.store.password=密码


具体签名相关的东西网上自己看一下

4

再次执行 C:\Documents and Settings\Administrator>ant release 看一下你的工程目录下的bin目录是不是多了MainActivity-release.apk





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值