Intermittent “Failure attempting to launch” in ios UITest

拈花ヽ惹草 提交于 2019-11-30 14:10:33

I had this issue with Xcode 8.3.2 and iOS 10.3 Simulator. All of the tests started failing after updating the Mac OS to Sierra.

We would see the above exception at:

XCUIApplication().launch()

and the first time the test tries to access the XCUIApplication() it crashes.

The fix was to move the XCUIApplication().launch() call to the setUp() function.

Background

In our case the problem was multithreading. We wanted to make sure some other code was executed before the app started. That code ran asynchronous and started the app once it returned. The fix makes sure that the app is launched first and on the main thread. Now everything works fine again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!