appium 获取 appPackage appActivity
- 手机链接 电脑 (usb 开发者模式打开)
在这里 model 就是设备的名称,就是后文需要用到的 deviceName 变量 dream2qltechn
- 手机打开 需要获取 appPackage appActivity 的包
-
运行 命令
➜ ~ adb shell # 进入设备 dream2qltechn:/ $ dumpsys window windows | grep -E 'mCurrentFocus' #这行才是关键 mCurrentFocus=Window{888a5e2 u0 com.tencent.mobileqq/com.tencent.mobileqq.activity.SplashActivity} dream2qltechn:/ $ # **appPackage** :com.tencent.mobileqq # **appActivity** :com.tencent.mobileqq.activity.SplashActivit1234567➜ ~ adb shell # 进入设备dream2qltechn : / $ dumpsys window windows | grep - E 'mCurrentFocus' #这行才是关键mCurrentFocus = Window { 888a5e2 u0 com . tencent . mobileqq / com . tencent . mobileqq . activity . SplashActivity }dream2qltechn : / $# **appPackage** :com.tencent.mobileqq# **appActivity** :com.tencent.mobileqq.activity.SplashActivit{ "platformName": "Android", "deviceName": "SM_G9550", "appPackage": "com.tencent.mobileqq", "appActivity": "com.tencent.mobileqq.activity.SplashActivity" }1234567{"platformName" : "Android" ,"deviceName" : "SM_G9550" ,"appPackage" : "com.tencent.mobileqq" ,"appActivity" : "com.tencent.mobileqq.activity.SplashActivity"}