references :
http://developer.android.com/tools/building/building-cmdline.html
http://stackoverflow.com/questions/9932498/signing-applications-automatically-with-password-in-ant
http://www.vogella.com/tutorials/ApacheAnt/article.html
1-download binary distribution from
http://ant.apache.org/bindownload.cgi
2-extract goto C:\apache-ant-1.9.3\bin, edit ant.bat, on top add (warning short name for 'program files') :
3-to use ant, should have a build.xml file, goto androidSDK\tools execute :
build.xml generated!
4a-goto "path to your java project" create a file called 'ant.properties' write :
4b-delete the bin dir from your project! or add it as build action aka (on build.xml) :
5-goto X:\apache-ant-1.9.3\bin execute :
to avoid UTF-8 errors use :
tested and working with a PRJ has reference to project library..
FYI
Developers no longer need to add the android:debuggable attribute to the tag in the manifest — the build tools add the attribute automatically. In Eclipse/ADT, all incremental builds are assumed to be debug builds, so the tools insert android:debuggable="true". When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts the android:debuggable="true" attribute, while ant release does not. If android:debuggable="true" is manually set, then ant release will actually do a debug build, rather than a release build. (source http://lfhck.com/question/236144/android-debuggable-default-value)
#ant
http://developer.android.com/tools/building/building-cmdline.html
http://stackoverflow.com/questions/9932498/signing-applications-automatically-with-password-in-ant
http://www.vogella.com/tutorials/ApacheAnt/article.html
1-download binary distribution from
http://ant.apache.org/bindownload.cgi
2-extract goto C:\apache-ant-1.9.3\bin, edit ant.bat, on top add (warning short name for 'program files') :
JavaScript:
set JAVA_HOME=c:\Progra~1\Java\jdk1.7.0_07
3-to use ant, should have a build.xml file, goto androidSDK\tools execute :
JavaScript:
android update project --target android-16 --subprojects --path "path to your java project"
build.xml generated!
4a-goto "path to your java project" create a file called 'ant.properties' write :
JavaScript:
key.store.password=mypasswordOne
key.alias.password=mypasswordTwo
key.store=c:\\test\\private (warning must be double slashes)
key.alias=mykeystore
4b-delete the bin dir from your project! or add it as build action aka (on build.xml) :
JavaScript:
<delete dir="bin"/>
5-goto X:\apache-ant-1.9.3\bin execute :
JavaScript:
ant release -buildfile "path to your java project"
to avoid UTF-8 errors use :
JavaScript:
ant -D"file.encoding=UTF-8" release -buildfile "path to your java project\build.xml"
tested and working with a PRJ has reference to project library..
FYI
Developers no longer need to add the android:debuggable attribute to the tag in the manifest — the build tools add the attribute automatically. In Eclipse/ADT, all incremental builds are assumed to be debug builds, so the tools insert android:debuggable="true". When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts the android:debuggable="true" attribute, while ant release does not. If android:debuggable="true" is manually set, then ant release will actually do a debug build, rather than a release build. (source http://lfhck.com/question/236144/android-debuggable-default-value)
java.exe is not recognized as an internal or external command
JavaScript:
//http://stackoverflow.com/a/12128228/1320686
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_06
set path="%JAVA_HOME%/bin;%path%;
ant
#ant