Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open app with package name using ADB

Tags:

android

adb

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?

like image 384
Carlo B. Avatar asked Mar 28 '14 19:03

Carlo B.


People also ask

How do I access files using adb?

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!


1 Answers

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.

like image 114
Carlo B. Avatar answered Sep 20 '22 20:09

Carlo B.