Self-motivated test often encountered this problem, about this topic, methods are numerous, our aim is to find a more simple and reliable:
Method One:
First enter the cmd form, after the ADB shell:
Cd/data/data
Ls
Can see the package name, the shortcomings are very obvious, must root mobile first
Method Two:
Enter the cmd form first:
adb shell ps|findstr/i "keyword"
It doesn't have to be a root cell phone, well, it's still alive.
Method Three:
Start the program on the phone, USB connection to the computer, and then start android-sdk/tools/monitor.bat,device inside can see the package name.
The above three ways to see the package name is still alive, it may be slightly necessary to guess, but all can achieve the goal, but the start of the Task form (activity) is what, these methods are not seen.
Get, not suspense, direct introduction of my proposed method:
Method Four:
First on the phone to execute a program, enter the first interface can be, do not go to more operations. USB connection to the computer, go to cmd form to execute:
adb shell "Dumpsys usagestats" |findstr/i "keyword"
Keyword is the keyword you need to match. This does not use the root phone. Originally, this dumpsys usagestats was used to record which activity times and times of the program were opened. This can be used to directly see what activity your program is opening.
Or is it not true? Then take the following am start to try
You can try to run the following command under CMD:
|
ADB shell "AM start-n Com.tencent.mm/com.tencent.mm.ui.launcherui" |
Mobile QQ |
ADB shell "AM start-n com.tencent.mobileqq/com.tencent.mobileqq.activity.splashactivity" |
Weibo |
ADB shell "AM start-n com.sina.weibo/com.sina.weibo.splashactivity" |
QQ Space |
ADB shell "AM start-n com.qzone/com.tencent.sc.activity.splashactivity" |
Just assume that you can directly see Androidmanifest.xml in the program project or can directly ask the development, then this article you do not have to read.
done!
Teach you how to find the package name of Android app and start activity