diego
diego

Reputation: 120

Xcode 5 Tests Not Running

I get the following message from Xcode when I try to run my tests:

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'

This question has already been asked here: Xcode 5 throws "Library not loaded" error when adding a test target but the solution doesn't apply to me as this is a Mac app. Any ideas?

Upvotes: 2

Views: 1548

Answers (2)

mz2
mz2

Reputation: 4702

This is because of sandboxing.

Same issue also happens with OCUnit (in both Xcode 4 and 5): XCTest - "Test failed"

There's instructions for testing a sandboxed app here: http://marcschwieterman.com/blog/testing-in-the-sandbox/

Upvotes: 4

Tony J Stark
Tony J Stark

Reputation: 306

Do you have App Sandbox under Capabilities for your target enabled? Switching that off worked for me.

Upvotes: 4

Related Questions