Reputation: 35
I dislike using Eclipse and wish to start an example Android project from the command-line, how can i do this? Is there a way to use "android create project" command to automatically pull in example code from the SDK? A similar method to the following perhaps?
android create project --package com.example.helloandroid \
--activity HelloAndroid \
--target 1 \
--path HelloAndroid
Upvotes: 1
Views: 3517
Reputation: 74780
Here is an example how to build and run ApiDemos
sample project.
../samples/android-#/ApiDemos
, where # is API Level. android list targets
and find target with API Level that is equal or higher then what you've chosen for # on step 1. Lets call this target X. In my case X equals 21. It looks like in your case X equals 1.android update project -p . -n ApiDemos -t X
(change X to correct value)ant debug
adb install bin/ApiDemos-debug.apk
For Step 6 to succeed you need to connect your device to computer via USB. Make sure you've checked Setting->Applications->Development->USB Debugging
. Also you can verify that adb
can see your device running adb devices
in the terminal.
Now sample project is built and installed on your device.
Upvotes: 4