appium运行报错: ‘Command ‘D:\android-sdk\platform-tools\adb.exe -P 5037 -s 3462760482002OA shell am star

Appium 运行报错:selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.hlfonts.richway’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘D:\android-sdk\platform-tools\adb.exe -P 5037 -s 3462760482002OA shell am start -W -n com.hlfonts.richway/.ui.activity.LoginActivity -S’ exited with code 4294967295’; Stderr: 'Exception occurred while executing ‘start’:
错误分析:
使用adb shell dumpsys window | findstr “usedApp” 查找对应的包名和界面名称的时候未获取到最上层的app界面名称 导致跳转的时候都导致报错:
解决方法
使用 adb shell dumpsys activity activities | findstr mActivityComponent
获取所有的包名和界面名称
其中mActivityComponent 后面跟的是当前界面的包名和界面名称
注意:
第一命令可以获取大部分应用真实的包名和界面名称,但是部分应用可能存在蒙层,从而可能导致报错。

多个程序在真机后台运行的时候可能获取到多个包名和界面名
结合第一个名称组合使用可以快速定位该界面名

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值