android 友盟多渠道打包工具,使用ANT+Umeng工具实现多渠道打包编译APK

Android app开发完成以后第一项工作就是推广,因为国内的应用市场太多,APK会发布到各个应用商店,所以对每个渠道的推广效果进行监控就变的很有必要。

我个人采用了ANT+Umeng多渠道打包工具解决了上面这个问题。很多大牛一个ANT就搞定所有事了。之前在网上研究了很多关于ANT多渠道自动打包的文章,看的很累。如果不追求极致的话,采用我目前的方法效果也是一样的。好了,马上进入正题。

我使用的ADT版本是22.62,关于ANT的编译会用到3个文件:

build.xml

local.properties

ant.properties

平时我们调试的时候Eclipse会结合ANT自动帮我们生成Debug签名版的APK,所以我想到系统应该在某个地方已经配置好相关的build.xml文件了。果不其然在ANDROID_SDK目录下发现了一个Build文件(sdk/tools/ant/build.xml),这应该就是Debug的时候ANT所使用的build文件了。所以在我自己写的build文件中就引用到了它,同时也引用到local.properties和ant.properties这两个文件。

build.xml具体内容如下:

message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."

unless="sdk.dir"

/>

local.properties在这里的作用就是指定ANDROID_SDK的路径

local.properties详细内容如下:

# 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.

sdk.dir=D:\\adt-bundle-windows-x86-20140321-20140805\\adt-bundle-windows-x86-20140321\\sdk

ant.properties 文件中需要指定签名证书,别名,签名密码等。

ant.properties 详细内容如下:

# This file is used to override default values used by the Ant build system.

#

# This file must be checked into Version Control Systems, as it is

# integral to the build system of your project.

# This file is only used by the Ant script.

# You can use this to override default values such as

# 'source.dir' for the location of your java source folder and

# 'out.dir' for the location of your output folder.

# You can also use it define how the release builds are signed by declaring

# the following properties:

# 'key.store' for the location of your keystore and

# 'key.alias' for the name of the key to use.

# The password will be asked during the build when you use the 'release' target.

key.store=E:\\***\\***

key.alias=*****

key.store.password=****

key.alias.password=****

把这3个文件放到Eclipse项目的根目录:

bVcRL9

最后运行build文件就可以编译打包了。

如果你在项目中用到了其他的第三方项目工程,那么依样画葫芦即可(复制这3份文件到你所引用的工程文件根目录即可)

如果有初学者不明白的可以邮件给我:wuyiqi2003@gmail.com

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值