To find the package, use adb shell pm list packages
. There will more than likely be a lot of packages listed. If you know a part of the package name, you can use grep to limit your results. If you were looking for the Facebook package name, you could use adb shell pm list packages | grep facebook
and it would only show results with facebook in it.
From there, you need you find the class to start.
adb shell
dumpsys package | grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+com.packagename/[^[:space:]]+" | grep -oE "[^[:space:]]+$"
(make sure you change the "com.packagename" part to the name of your package.
- Find the class you want to use from the output list. Most apps will have a class of
.SplashActivity
, .HomeActivity
, or .Main
but you will have to find the one for your app
- When you have that, use
am start -n com.packagename/.Class
where your package name replaces com.packagename
and the class you chose replaces .Class
.
One thing to note. In step 1, we used the command adb shell
so we are in the of the android device issuing the commands after. If you are issuing the am start
command at the main terminal screen, you will have to add adb shell
before am start
.
I used the zebra site a while back to get this info initially so i left it here for your reference as well.