If you are happy to use Eclipse while you are improving the build, then go to the command line for the final build, and then using Ant it is very easy to get what you want with very little effort or customization.
Assumptions
1) . Your sources are in the Android workspace, and in the end you will get two sets of binary files: one made by Eclipse, the other made by Ant, will be outside the workspace, as set by the PROPERTIES file
2) You are using SDK14 or 15 (Ant changed to 14)
3) You have Ant installed and in your path - you need to have Ant 1.8.2 - this is not the one used by Eclipse, you may have to get it from the Apache website, itβs easy to install
Steps
1) Make a sample project from the command line, as described in http://developer.android.com/guide/developing/projects/projects-cmdline.html
For example, I used: android create project --target 8 --name Sample15App --path c: \ dev \ projects \ samples \ Sample15 - Sample15Activity --package com.me.samplefifteen
This will create a directory and some files that you will use later as a template in your projects.
2) Create a sample project in your workspace from Eclipse, I made an EclipseSample in one of my workspaces
3) Copy the following files from Sample15App to the root of your EclipseSample project:
build.xml ant.properties local.properties
4) Modify ant.properties (which is initially empty) to look like:
projectname=EclipseSample workspace.dir=/dev/projects/EclipseIndigo/AndroidWorkTwo base.dir=${workspace.dir}/${projectname} outbasebase.dir=/dev/projects/AntBuilds outbase.dir=${outbasebase.dir}/${projectname} ant.project.name=${projectname} out.dir=${outbase.dir}/bin layout.dir=${base.dir}/res/layout source.dir=${base.dir}/src
From this you can see that my workspace is / dev / projects / EclipseIndigo / AndroidWorkTwo
The eclipse project below it is in the EclipseSample directory
I want my apks to fall into / dev / projects / AntBuilds / EclipseSample (i.e. outbasebase combined with the project name - so for other projects you can use a very similar ant.properties change projectname file)
5) IMPORTANT - CHANGE build.xml file
Comment or delete the line:
<project name="Sample15App" default="help">
just replace it
<project>
It just means that it will take the project name from ant.properties, not build.xml, and you can use the same build.xml in all your projects, only ant.properties needs to be changed
6) try with "ant debug" to build debug apks in / dev / projects / AntBuilds / EclipseSample
7) Finally, if you want to automate the assembly of the release (signing and entering the password automatically), add lines, for example
key.store.password=YourPassword key.alias.password=YourPassword key.store=c:/users/you/yourrelease-key.keystore key.alias=release_alias
in ant.properties and then just type "ant release"
If you do not add them, he will tell you what you are signing manually, and since no password entries were found in 'build.properties' (it was what ant.properties was called pre SDK 14, they should have fixed it!)