събота, октомври 23, 2010

Android - build samples without Eclipse

Go to the SDK samples directory and to the project directory that should be built:
cd %ANDROID_SDK%\samples\android-7
cd LunarLander
The project initially doesn't have build.xml file, which is needed by ANT to make the .apk of the application.

To create a build.xml file, the project should be updated so that it knows for which target it should be built (AVD) - android 1.5/1.6/2.0, etc.
android update project --target 3 --path .
The command will update the project in the current path (.) to use libraries for Android 1.6 (Target 3) and this command will also create build.xml file.

Next ANT can build the project and it can be installed on the emulator:
ant debug
adb install -r bin\ProjectName-debug.apk

Няма коментари: