How to launch an Android application from the command line?

How to launch an Android application from the command line?

There is a similar question, but I can not find any good answers.

+53
android command-line
Jul 07 '11 at 16:26
source share
3 answers
adb shell am start -n com.package.name/com.package.name.ActivityName 

Or you can use this directly:

 adb shell am start -n com.package.name/com.package.name.ActivityName 

You can also specify the actions that will be filtered by your intent filters:

 am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName 
+86
Jul 07 '11 at 16:30
source share

You can use:

 adb shell monkey -p com.package.name -c android.intent.category.LAUNCHER 1 

This will launch the action of the LAUNCHER application using the monkey testing tool.

+15
Oct 08 '15 at 12:00
source share

An example is here .

Paste below:

This is about how to run an Android application from adb shell.

Team: am

Look for the calling path in AndroidManifest.xml

Browser Application ::

 # am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity Starting: Intent { action=android.intent.action.MAIN comp={com.android.browser/com.android.browser.BrowserActivity} } Warning: Activity not started, its current task has been brought to the front 

Application Settings ::

 # am start -a android.intent.action.MAIN -n com.android.settings/.Settings Starting: Intent { action=android.intent.action.MAIN comp={com.android.settings/com.android.settings.Settings} } 
+11
Jul 07 2018-11-11T00:
source share



All Articles