appium+真机测试打开应用apk,报:selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Permission to start activity denied.)

连接真机安卓版本10,总是报错:selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Permission to start activity denied.)   这是因为“启动activity的权限被拒绝”,查找原因说“启动activity的方式不对”

配置及错误信息如下:

appium+真机测试打开应用apk,报:selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Permission to start activity denied.)

 

解决方式:

问题的出在这里配置有问题 ,desired_caps[‘appActivity‘] = ‘.activity.MainActivity_‘

        把MainActivity_换为WelcomeActivity_  :desired_caps[‘appActivity‘] = ‘.activity.WelcomeActivity_‘

 其实‘.activity.MainActivity_‘这个activity还是根据log中启动信息查询的,但是却不对,我也很奇怪!后来知道这个“MainActivity”外部应用是没有权限打开!!!

 

更换之后,成功启动了app.

 

appium+真机测试打开应用apk,报:selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Permission to start activity denied.)

上一篇:速耀达App简介


下一篇:微信公告号实现原理简单介绍;