Automated testing often encountered this problem, about this topic, methods are numerous, our aim is to find a relatively simple and reliable:
Method One:
First enter the CMD window, after the ADB shell:
Cd/data/data
Ls
You can see the package name, the disadvantage is obvious, must root phone first
Method Two:
First enter the cmd window:
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 a bit of guessing, but all can achieve the goal, but the task of the Start window (activity) is what, these methods are not seen.
Get, not suspense, direct introduction of my proposed method:
Method Four:
First run a program on the phone, enter the first interface on the line, do not go to more operation, USB connection to the computer, into the cmd window to run:
adb shell "dumpsysusagestats" |findstr/i "keyword"
This also does not use root phone, originally this Dumpsys usagestats is used to record which activity times and time of the program opened the information, here can be used to directly see your program to open what activity.
You can try to execute 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" |
However, if you can directly see the program in the project Androidmanifest.xml or can directly ask the development, then this article you do not have to read.
done!