====== Android build system with ant ====== * http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html ===== Adding build.xml to an existing project ===== Change to project directory and call: android update project --path . Updated local.properties Clean and build project to check that's it works. ant ant clean ant debug ant installd ===== Creating a new project with build.xml ===== android create project --name YourProjectName --path $(pwd)/YourProject --target android-19 --package com.company.testproject --activity MainActivity ===== Synchronizing with Eclipse ===== If you open the Ant build script, build.xml, in Eclipse, you will see an error on the second line of the file at this line: . The problem with this line is that it is saying that the default Ant target is "help", but the actual Ant targets used in the build file are imported from another location, which the Eclipse editor does not recognize. The import is done at the line The rules file is imported from /platforms//templates/android_rules.xml To customize some build steps for your project: - copy the content of the main node from android_rules.xml - paste it in this build.xml below the task. - disable the import by changing the setup task below to Find the android_rules.xml file in your Android SDK. For example, mine is located at C:\dev\android-sdk-windows\platforms\android-4\templates. There, copy almost the entire file, excluding the project node (copy below to above ), and paste it in your build.xml file. Also, change the line to . ===== Using a Java configuration file ===== ===== Testing Android ===== * http://developer.android.com/tools/testing/testing_otheride.html * http://www.vogella.com/tutorials/AndroidTesting/article.html