1, view the current list of mobile devices connected
Window open command, execute adb devices -l
the command to list the devices connected to the android computer.
C:\Users\Administrator>adb devices -l
adb server version (31) doesn't match this client (41); killing...
* daemon started successfully
List of devices attached
e9956a15 unauthorized transport_id:1
2, night God simulator connection
adb connect 127.0.0.1:62001
3, query the package name appPackage / appActivity
PC-free apk
If your application is already installed on the phone, you can directly open the application on your phone, enter the interface you want to operate
Then execute
adb shell dumpsys activity recents | find "intent={"
The first line is the current application, we are particularly concerned about the last
cmp=tv.danmaku.bili/.ui.splash.SplashActivity
package is the name of the application tv.danmaku.bili
Activity is to start the application .ui.splash.SplashActivity
PC has apk
androidsdk \ build-tools \ 29.0.3 \ aapt.exe run the corresponding directory
Query apppackage
D:\develop_study\androidsdk\build-tools\29.0.3\aapt.exe dump badging D:\bili.apk | find "package: name="
Query appActivity
D:\develop_study\androidsdk\build-tools\29.0.3\aapt.exe dump badging D:\bili.apk | find "launchable-activity: name="
Package name may be omitted.