xie lee
xie lee

Reputation: 98

How to build and package the android project with Ant

How to build and package the android project with Ant.

I want to build and package a android project automatic with Ant,not the Eclipse.

Someone give me some examples or some Ant build files.

Upvotes: 0

Views: 2087

Answers (1)

MH.
MH.

Reputation: 45493

Assuming you are inside the root folder of your project, execute from a terminal/shell/console/command prompt:

android update project -p .

This will generate the necessary files, including build.xml. Modify it for your requirements, or leave it as it is for standard build behaviour.

To create a debug build, execute:

ant debug

Or swap out debug for release for a release build. Note that you will need to provide details to the release key in order to complete the signing process (keystore location, keystore password, key alias and key password). If you don't, you will end up with an unsigned apk that you'll have to manually sign using the appropriate key.

I prefer to do a clean with most builds as well, so the command I issue with every release build looks like:

ant clean release

References:

Upvotes: 2

Related Questions