转自: http://learnandroid.blogspot.com/2008/01/run-android-application-from-command.html
Sometime, we want to start the android application program from command line (Android Shell). Before, we usually clicking on the icon at application folder to run our program. So, there is an alternative way to run the program.
We use the Android Shell and issue am command to brought up the program. below is an example to do that.
1. Make sure that android emulator is running
2. Enter the shell with issuing command at command shell (prompt): adb shell
3. Issue am command. am command syntax is as follow :
am [start|instrument]
am start [-a
[-c
[-e
[-n
am instrument [-e
[-w]
for example we have android program with Manifest like below:
.
.
To run the code issue command like this (in one line):
am start -a android.intent.action.MAIN -n
com.iftitah.android.contact/com.iftitah.android.contact.Contact
ok, Have a nice try!
No comments:
Post a Comment