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?
Open cmd type adb shell then press enter. Type ls to view files list. At the DOS prompt, adb shell ls -R > junk lists all files and puts results into file junk which you can then edit via Notepad or whatever and see more than you'd want to, but your files, too!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With