2

当我尝试运行测试时,我从 Xcode 收到以下消息:

2013-11-13 09:02:57.849 MyProject[378:303] Error loading /Users/tatami/Library/Developer/Xcode/DerivedData/MyProject-gcralijdlibafgeyfwfeiynnothy/Build/Products/Debug/MyProjectTests.xctest/Contents/MacOS/MyProjectTests:  dlopen(/Users/tatami/Library/Developer/Xcode/DerivedData/MyProject-gcralijdlibafgeyfwfeiynnothy/Build/Products/Debug/MyProjectTests.xctest/Contents/MacOS/MyProjectTests, 262): no suitable image found.  Did find:
/Users/tatami/Library/Developer/Xcode/DerivedData/MyProject-gcralijdlibafgeyfwfeiynnothy/Build/Products/Debug/MyProjectTests.xctest/Contents/MacOS/MyProjectTests: open() failed with errno=1
IDEBundleInjection.c: Error loading bundle '/Users/tatami/Library/Developer/Xcode/DerivedData/MyProject-gcralijdlibafgeyfwfeiynnothy/Build/Products/Debug/MyProjectTests.xctest'

这个问题已经在这里问过:Xcode 5 throws "Library not loaded" error when added a test target 但该解决方案不适用于我,因为这是一个 Mac 应用程序。有任何想法吗?

4

2 回答 2

4

您是否在功能下为您的目标启用了 App Sandbox?关闭它对我有用。

于 2014-01-29T15:13:38.567 回答
4

这是因为沙盒。

同样的问题也发生在 OCUnit(在 Xcode 4 和 5 中):XCTest - “测试失败”

这里有测试沙盒应用程序的说明:http: //marcschwieterman.com/blog/testing-in-the-sandbox/

于 2014-03-02T22:46:30.903 回答