xcode10 - 更新到 Xcode 10 后 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.))
解决方案
首先,如果您使用的是 Cocoapods,请确保您的测试目标设置了继承的搜索路径,例如:
# MARK: Common pods
abstract_target 'AppCommon' do
pod 'Alamofire'
target 'MyFrameworkA' do
project './MyPath/MyFrameworkA/MyFrameworkA.xcodeproj'
target 'MyFrameworkATests' do
inherit! :search_paths
end
end
end
接下来,在FrameworkA的Build 阶段,确保将任何其他框架(A 中使用的 B、C)设置为目标依赖项并添加到Linked Binary With Libraries中。
最后,确保您的FrameworkATests目标在Target Dependencies中有您的FrameworkA ,并且也在Linked Binary With Libraries阶段添加。
推荐阅读
- docker - 自定义网络是否替换 docker-compose.yml 中的默认网络
- r - 我的 R 每日时间序列中只有一个频率
- java - 如何在 Spring Boot 中升级 Spring 版本
- mysql - HSQL 中的大写
- r - rvest read_html 输入不正确 UTF-8 编码错误
- java - Ratpack 的 Promise.cache 与 ParallelBatch 中的多个下游承诺
- javascript - 最大高度变化的 CSS 动画
- angular - 在 Angular 6 中使用 PixiJs
- netlogo - “不能在观察者上下文中使用 XXX,因为只有补丁”
- javascript - Upsert 正在复制输入,我该如何防止这种情况?