Appium APPium 脚本驱动真机测试,抛异常 selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.qhb.insurance.uat' application

lanxian · 2020年03月31日 · 最后由 lanxian 回复于 2020年03月31日 · 2903 次阅读

环境 python2.7 /APPium 1.15.1/手机版本 android 10
报错信息:
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.qhb.insurance.uat' 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:\MyProjectApplication\Android\android-sdk\platform-tools\adb.exe -P 5037 -s HYC5T19C05020189 shell am start -W -n com.qhb.insurance.uat/com.qhb.insurance.view.SettingActivity -S' exited with code 255'; Stderr: 'Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=com.qhb.insurance.uat/com.qhb.insurance.view.SettingActivity } from null (pid=26962, uid=2000) not exported from uid 10228

java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.qhb.insurance.uat/com.qhb.insurance.view.SettingActivity } from null (pid=26962, uid=2000) not exported from uid 10228
at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(libmapleservices.so:5782548)
at com.android.server.wm.ActivityStarter.startActivity(libmapleservices.so:5878680)
at com.android.server.wm.ActivityStarter.startActivity(libmapleservices.so:5885048)
at com.android.server.wm.HwActivityStarter.startActivity(libmaplehwServices.so:3734960)
at com.android.server.wm.ActivityStarter.startActivityMayWait(libmapleservices.so:5402924)
at com.android.server.wm.HwActivityStarter.startActivityMayWait(libmaplehwServices.so:3593884)
at com.android.server.wm.ActivityStarter.execute(libmapleservices.so:5886420)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(libmapleservices.so:8145724)
at com.android.server.am.ActivityManagerService.startActivityAndWait(libmapleservices.so:8146604)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(libmapleservices.so:8149424)
at com.android.server.am.ActivityManagerShellCommand.onCommand(libmapleservices.so:8167028)
at android.os.ShellCommand.exec(libmapleframework.so:8790304)
at com.android.server.am.ActivityManagerService.onShellCommand(libmapleservices.so:8168756)
at android.os.Binder.onTransact(libmapleframework.so:6993908)
at android.app.IActivityManager$Stub.onTransact(libmapleframework.so:8143156)
at com.android.server.am.ActivityManagerService.onTransact(libmapleservices.so:7411484)
at com.android.server.am.HwActivityManagerService.onTransact(libmaplehwServices.so:4278144)
at android.os.Binder.execTransactInternal(libmapleframework.so:8310780)
at android.os.Binder.execTransact(libmapleframework.so:8310004)'; Code: '255'

请教各位大神,这是什么导致的

共收到 4 条回复 时间 点赞

Original error: 'Command 'D:\MyProjectApplication\Android\android-sdk\platform-tools\adb.exe -P 5037 -s HYC5T19C05020189 shell am start -W -n com.qhb.insurance.uat/com.qhb.insurance.view.SettingActivity -S' exited with code 255'; Stderr: 'Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=com.qhb.insurance.uat/com.qhb.insurance.view.SettingActivity }

恒温 回复

你好!你有遇到吗?怎么处理的,在网上找了一圈了,还不知道怎么搞,我在自己模拟器上可以,模拟器是安卓 4.4.2,真机就不行

lanxian 回复

你把英文翻译一遍

恒温 回复

selenium.common.exceptions.WebDriverException:消息:处理命令时发生未知的服务器端错误。 原始错误:无法启动 “ com.qhb.insurance.uat” 应用程序。 请访问https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md进行故障排除。 原始错误:执行 adbExec 时出错。 原始错误:'命令'D:\ MyProjectApplication \ Android \ android-sdk \ platform-tools \ adb.exe -P 5037 -s HYC5T19C05020189 shell am start -W -n com.qhb.insurance.uat / com.qhb.insurance .view.SettingActivity -S'以代码 255'退出; Stderr:“安全例外:权限被拒绝:启动意图{flg = 0x10000000 cmp = com.qhb.insurance.uat / com.qhb.insurance.view.SettingActivity}从 null(pid = 26962,uid = 2000)不从 uid 导出 10228

谷歌翻译了一下,信息有点乱,好像是说权限被拒了,手机开放了 USB 调试,启动脚本在手机端自动安装了 APPium-settings 和 appium.uiautomator2.server 正常来说应该就可以去到手机的了吧

lanxian 关闭了讨论 04月01日 14:26
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册