[Android] build Android app based on Linux command Line (V): Ant build command

Source: Internet
Author: User

The Android SDK provides Android tools to automatically generate ANT build files in the project root directory build.xml[1]. After entering the project root directory, you can use the following ANT command [2].

  Ant Clean

Clean up the project. The command is responsible for cleaning up the output from the other ANT commands listed in this article.

  Ant Debug

Build the Debug package.

  Ant Emma Debug

Build a test project in a way that opens instrumentation, which you can use for code coverage testing.

  Ant Release

Build the release package.

  Ant instrument

Build a debug package that supports instrumentation. This command is called automatically when building support code coverage (ant Emma Debug) tests.

  Ant <build_target> Install

Build and install packages.

  Ant Installd

Install a debug package that has already been compiled.

  Ant Installr

Install an already compiled release package.

  Ant Installt

Install a test package that has already been compiled.

  Ant Installi

Install a package that supports instrumentation. Typically, you do not invoke the command, but instead call it automatically when you install a test package.

  Ant Test

Run the test. The prerequisite is to install the. apk file that is ready for testing beforehand.

  Ant Debug Installt Test

Build the test project and the project under test, install two. apk files and run the tests.

  Ant Emma Debug Install Test

Build test projects and tested projects, install two. apk files, run tests, and support code coverage testing.

Note:

[1] If you use Eclipse for development, you may not find the Build.xml file in the project root because Eclipse has its own way of compiling it without using Ant to build it. To solve this problem, you can go to the project root directory and run the android Update command to update the project, and the Android tool will automatically create the Build.xml file in the project root directory.

[2] to understand the ant command provided by Build.xml, you can go to the project root directory to run $ ANT-P or $ ant-projecthelp, which will print the target (i.e. ANT command) that can be used. Learn more about ant build and see [Java] Apache Ant Build Basics Tutorial.

[Android] build Android app based on Linux command Line (V): Ant build command

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.