8

I'm running iOS simulator unit tests on the command line using xctest. First I build the target:

xcodebuild -project "build/MyApp.xcodeproj" -target "MyApp Unit Tests" -configuration "Debug" -sdk "iphonesimulator" build

And then run xctest on the test bundle:

xcrun xctest "build/build/Debug-iphonesimulator/MyApp Unit Tests.xctest"

This works fine, and can link frameworks that are in /System/Library/Frameworks like Security. But xctest breaks as soon as I add an iOS SDK framework like MobileCoreServices, giving me:

Library not loaded: /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices

The unit tests run fine in Xcode, and the unit test target includes $(PLATFORM_DIR)/Developer/Library/Frameworks in its Frameworks Search Paths.

Anybody know the right way to make xctest find iOS frameworks?

Luke
  • 6,780
  • 6
  • 39
  • 69

1 Answers1

0

The test target needs to be able to look for frameworks in the built product of MyApp. You should add a framework search path to the test target:

$(CONFIGURATION_TEMP_DIR)/MyApp.build/DerivedSources
pbergson
  • 230
  • 3
  • 9