This question already has an answer here:
I installed Eclipse and Android SDK already. Everything is running fine.
I want to install an .apk file so I follow the instruction already. But the problem is, when I start the emulator, it doesn't run my app automatically.
Is there a command in the terminal that allow me to run the specific app that I ask for it?
I keep this build-and-run script handy, whenever I am working from command line:
I used all the above answers and it was giving me errors so I tried
adb shell monkey -p com.yourpackage.name -c android.intent.category.LAUNCHER 1
and it worked. One advantage is you dont have to specify your launcher activity if you use this command.
Use the
cmd activity start-activity
(or the alternativeam start
) command, which is a command-line interface to the ActivityManager. Useam
to start activities as shown in this help:For example, to start the Contacts application, and supposing you know only the package name but not the
Activity
, you can useor the alternative
See also http://www.kandroid.org/online-pdk/guide/instrumentation_testing.html (may be a copy of obsolete url : http://source.android.com/porting/instrumentation_testing.html ) for other details.
To terminate the application you can use
or the more drastic
You can Start the android Service by this command.