1.使用USB数据线连接手机和电脑后,在手机上选择开发者模式,打开USB调试模式,注意不能选择充电模式
2.在cmd中输入:adb devices,查看是否连接成功
3.在cmd中输入命令appium或者appium -a 127.0.0.1 -p 4723 -U HJS0219105008624 --no-reset(U后面的数为udid,在查看手机连接的时候会显示---步骤2)启动服务器,或者以管理员身份运行appium
4.获取udid:adb devices
5.获取Android版本号:adb shell getprop ro.build.version.release
6.获取产品名(型号):adb shell getprop ro.product.model
7.获取包名:adb shell pm list packages | findstr 报名的部分字符 如:adb shell pm list packages | findstr com.lixing
① aapt获取包名:aapt dump badging apk路径 如:aapt dump badging D:\Apks\app2-debug.apk
② 要求APP已经安装在手机上,启动该APP,输入:adb shell dumpsys window w|findstr \/|findstr name=
③ 要求APP已经安装在手机上,启动该APP,输入:adb shell dumpsys window|findstr mCurrent 或 adb shell dumpsys window|findstr mCurrentFocus
8.获取第一个启动Activity: adb shell dumpsys activity activities