Apache Ant for Android Application

If you wish to develop using command line build tools, you need to install Apache Ant. Tooling for building Android Application with Maven are also available.

Building Android outside Eclipse involves using the command line or shell. You should be familiar with using a shell to work with Apache Ant.

// check your Apache Ant version
ant -version

The Eclipse project generation wizard does not create the required Apache Ant build.xml file. You can generated it on the command line.

android update project -p

You can build your project via Apache Ant
  
// clean the project
ant clean 

// build a debug version
ant debug 

// builds the debug version and installs it
ant debug install

If you want to release your application you can create the ant.properties file in your project directory. In this file you point to your signing key and the alias for it.

key.store=path/to/my.keystore 
key.alias=mykeystore 

 You can now create a release build.

// build release 
ant release

No comments:

Post a Comment