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