ios - 代码 8 : UI tests can't find library being tested

标签 ios xcode xcode8 xcode-ui-testing dyld

当我创建我的 iOS 项目时,我选择不包括 UI 测试。不过现在,我尝试添加它们,但是当我尝试执行它们时出现以下错误:

dyld: Library not loaded: @rpath/FrameworkBeingTested.framework/FrameworkBeingTested
Referenced from: <redacted>/TargetApplication.app/TargetApplication
Reason: image not found

我已经确认:

  • UI 测试包含在 Test 方案中,
  • UI 测试目标设置为使用正确的目标应用程序 (TargetApplication),并且
  • UI 测试文件是 FrameworkBeingTestedUITests 目标的成员。

最佳答案

当我将 UI 测试文件的目标成员更改为 FrameworkBeingTestedTests 而不是 FrameworkBeingTestedUITests 时,我找到了答案:

Error message

啊哈!问题是我的 FrameworkBeingTested 将 iOS 8.0 作为其最低目标,但 Apple 的 UI 测试框架需要 iOS 9.0 或更新版本。但是编译器并没有告诉我这个,而是告诉我它无法加载经过测试的库。我会为此提交雷达。

希望这对某人有帮助!

关于ios - 代码 8 : UI tests can't find library being tested,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40093301/

相关文章:

ios - 测试在 xcode 8 TEST_HOST 错误下停止工作

facebook - 使用 Swift 2.3 编译的模块无法在 Swift 3.0 中导入

ios - 从 FCM 向 iOS 设备发送 2-layer-json-payload 时出现问题

iphone - 多种语言的多个 SQLite 数据库?

ios - iCarousel 不显示我的图像 Objective-C

iphone - 更改 UITabBar 文本

ios - 如何防止在较旧的 iOS 设备上渲染使用 Zwoptex 生成的 sprite-sheet 时出现像素渗色?

iphone - 在 iOS 上加载压缩图像的最快方法是什么?

ios - (Swift) ViewController 的 UI 元素无法通过实现的委托(delegate)方法进行编辑

uikit - CGRectMake、CGPointMake、CGSizeMake、CGRectZero、CGPointZero 在 Swift 中不可用