Ant automated Multi-channel pack, Android batch pack speed up

Source: Internet
Author: User

While eclipse is easy to use, compiling and packaging Android projects is slow, especially when it comes to distributing apps to various channels, it's a little unrealistic to use eclipse to manually package the various channel packs, and then we use ant to help us automatically compile and pack.

To introduce ant in Eclipse, please refer to http://www.cnblogs.com/tt_mc/p/3891546.html, below are some of the problems I encountered when I packaged ant.

---------------------Cute Split-line------------------------------

First, according to the above steps to achieve their own, in the process also encountered a lot of problems.

1. Configure environment variables Android and Ant, here is an unknown explanation.

2. If your project has a third-party resource bundle, switch to the path of the resource project to convert it to ant to compile.

Execute command: Android update lib-project-p.

3. Switch to the root directory of the main project.

Execute command Android list target, can get Android compiled version. Its ID value is the value after the-t parameter.

D:\project3\minitools>android update project-n minitools-t 7-p./--subprojects

-N: Project name,-T compiled version,-p project path,--subprojects refers to the existence of a reference to a third-party resource project.

4. Signature file

1, not signed1.1, Android update lib-project-p.//compile the third-party library file into an ant-recognized1.2, Android update project-n test-t 7-p./--subprojects--executing in the master project1.3, Ant Release--production of unsigned apk.2, sign, complete step 1, and then configure the following2.1, configure KeyStore #keystore的路径, you must use a forward slash key.store= "E:/wp_android_sample/me.key"KeyStore's password Key.store.password=*****#alias名 Key.alias=Me #alias密码 Key.alias.password=******#渠道市场列表 market_channels=91,360, Wandoujia,baidu #版本号 version=1.2.1 2.2, add channel Packaging code to Build.xml2.3. Execute ant deploy to generate signatures for each channel bundle

5. In the CMD Command window, enter ant release to execute and produce the APK file in the bin directory of the project. 6, multi-channel package in accordance with the above method to do, in the replication of multi-channel package script to Build.xml, put under the condition node (before I put in the last, packaging error, then the package script to the location of the signature is ready).  second, the errors encountered and solutions1, error null returned 1  
B Uild failedd:\android\sdk\tools\ant\build.xml:  601:the following error occurred while  executing this   Line:D : \android\sdk\tools\ant\build.xml:  653:the following error occurred while  executing this   Line:D : \android\sdk\tools\ant\build.xml:  698: null  returned:1 

Workaround:

1. Find the aapt.ignore.assets in the Sdk/tools/ant/build.xml file and change its value to crunch.

2, in their own project root directory Build.xml file added: <property name= "aapt.ignore.assets" value= "!. Svn:!. git:\x3cdir\x3e_*:.*:! Cvs:!thumbs.db:!picasa.ini:!*.scc:*~:crunch "/> This way is only for their own project to take effect! Why there is \x3cdir\x3e this thing, is actually <dir>, but Ant build.xml is not allowed to use the ' < ' character, so to escape.

Reference

http://my.oschina.net/bigtiger/blog/201924

http://bbs.csdn.net/topics/380199724

http://www.cnblogs.com/qianxudetianxia/archive/2012/07/04/2573687.html

Android Bulk Pack speed up-1 minutes 900 markets not a dream

Ant automated Multi-channel pack, Android batch pack speed up

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.