Use ant to automatically package and sign Android programs on Mac

Source: Internet
Author: User
1. Create an android Project

Parameter description:-k/-- package is the namespace (package name)-A/-- name Project name-P/-- path project-T is the version number of the Target Platform

Command:./Android Create Project-K com. Android. Yunju-A Yunju-T 5-P ~ /Download/Yunju

Run the following command to List version numbers of different platforms: Android list targets

2. Existing project updates

To update an existing Android project with the created Project ant, you can update it (modify the version of the platform). In this way, ant configuration files such as build. XML are automatically added.

Command:./Android update project -- name Yunju-T 5-P ~ /Documents/Yunju/

Of course, you must go to the android SDK tools directory.

3. command line compilation and packaging

Reference: http://developer.android.com/tools/building/building-cmdline.html

The ant parameter is as follows: Debug: Build a release with a signature for debugging: Build an application, and the generated APK must be signed before release install: Install the package for debugging and build to the running simulator or device; reinstalluninstall

In the android project file: ant debug, the APK for debugging signature is packaged.

4. Release packaging method

Add

key.store=path/to/my.keystorekey.alias=mykeystorekey.store.password=wodemimakey.alias.password=wodemima

Re-run: ant release

-release-sign:     [echo] Signing final apk...  [signapk] Run cancelled: no changes to input file /Users/rongfzh/Documents/YunJU/bin/yunju-release-unsigned.apk [zipalign] Run cancelled: no changes to input file /Users/rongfzh/Documents/YunJU/bin/yunju-release-unaligned.apk     [echo] Release Package: /Users/rongfzh/Documents/YunJU/bin/yunju-release.apk[propertyfile] Updating property file: /Users/rongfzh/Documents/YunJU/bin/build.prop[propertyfile] Updating property file: /Users/rongfzh/Documents/YunJU/bin/build.prop[propertyfile] Updating property file: /Users/rongfzh/Documents/YunJU/bin/build.prop[propertyfile] Updating property file: /Users/rongfzh/Documents/YunJU/bin/build.prop-post-build:release:BUILD SUCCESSFULTotal time: 2 seconds

Generate three APK files, one of which is the signed and published APK.

You can also package and install now: ant release install

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.