Question

How do I open an app using ADB when I know the app's package name but not the component name of the main activity?

Était-ce utile?

La solution

If you only know the package name of the app you want to launch but not the name of it's main activity, use this command

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

Where com.android.chrome is the package name of the app you want to open.

The monkey command is used for making random touch and keyboard inputs on the connected device. The command above specifies that only one event can be issued, which is the open activity event. The -c option is to specify that only activities with the category android.intent.category.LAUNCHER can be opened, which is the action that is used as an entry point for the app.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top