排查/解决过程:
1、重新执行一次 -> 现象上来看,发现手机上没有打开目标APP,一直报相同错误
Original error: The instrumentation process cannot be initialized
2、报错里有:at UiAutomator2Server.startSession,初步怀疑是 io.appium.uiautomator2.server app问题
- 查看 Config 里 skipServerInstallation: true
- 改成 skipServerInstallation: false
3、重新执行一次,成功✅
4、然后再改下 skipServerInstallation: true
(这样下次执行,也不会重复安装io.appium.uiautomator2.server)
根本原因:
新设备没有安装 io.appium.uiautomator2.server,
并且本地配置里 skipServerInstallation: true,
->
这样就跳过安装io.appium.uiautomator2.server ,
导致新设备无法正常启动server
后续排查思路:
如出现类似报错,继续查看 appium 相关的 app 执行情况,如setting、uiautomator2.server 、uiautomator2.test
详细报错信息:
2021-01-07 10:09:47:443 [W3C] Encountered internal error running command: Error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.
2021-01-07 10:09:47:443 [W3C] at Object.errorAndThrow

本文讲述了如何排查并解决Appium中因新设备未安装io.appium.uiautomator2.server且配置中skipServerInstallation=true导致的初始化失败问题,涉及修改配置和检查设备状态。
最低0.47元/天 解锁文章
6127

被折叠的 条评论
为什么被折叠?



