Appium learning _01 (connection, apppackage name query, appactivity name query)

1, view the current list of mobile devices connected

Window open command, execute adb devices -lthe 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

1585628291686

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={"

1585798120678

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="
        

1585798627568

Query appActivity
D:\develop_study\androidsdk\build-tools\29.0.3\aapt.exe dump badging D:\bili.apk | find "launchable-activity: name="
        

1585798749687

Package name may be omitted.

Guess you like

Origin www.cnblogs.com/chenfei2928/p/12618617.html