更新到Xcode 10后,XCUITest的测试目标似乎无法正常工作

时间:2018-11-06 09:27:15

标签: xcode10 xcuitest

我从Xcode 9.4更新到了xcode 10,然后在尝试运行UI测试时似乎没有任何效果。测试应用会加载一段时间,然后测试失败,尽管在测试之前成功完成了构建。 源代码也可以成功构建,我可以在模拟器上运行该应用程序。

错误是:

Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: The test runner failed to load the test bundle. Executable cannot be loaded for some other reason, such as a problem with a library it depends on or a code signature/entitlements mismatch.))

2 个答案:

答案 0 :(得分:3)

首先,如果您使用的是Cocoapods,请确保测试目标已设置继承的搜索路径,例如:

WebBrowser

接下来,在您的 FrameworkA Build阶段中,确保所有其他框架(A中使用的B,C)设置为目标依赖项,并添加到带库的链接二进制文件

最后,确保您的 FrameworkATests 目标在 Target Dependencies 中具有您的 FrameworkA ,并添加到<还可以是strong>链接二进制与库阶段。

答案 1 :(得分:2)

Xcode 10引入了新的构建系统,该系统并行化了包括依赖项在内的大多数构建对话。新的构建系统可以检测到大多数配置问题。具有异常配置的项目必须开始失败,并且新的构建系统已检测到这一点。您应该了解的有关构建系统https://www.xcteq.co.uk/xcblog/five-things-you-must-know-about-xcode-10-new-build-system/

的所有信息