XCTest Doesn't Bind iOS Infrastructure

I run tests on the iOS simulator module on the command line using xctest . First I create a goal:

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

And then run xctest in the test suite:

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

This works great and can bind frameworks that are located in / System / Library / Frameworks, for example Security. But xctest breaks as soon as I add the iOS SDK infrastructure like MobileCoreServices, providing me with:

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

Unit tests run fine in Xcode, and the unit test target includes $(PLATFORM_DIR)/Developer/Library/Frameworks in the Framework search path.

Does anyone know the right way to do xctest find iOS frameworks?

+7
ios unit-testing xcode xcrun xctest
source share
1 answer

The goal of testing should be able to look for frameworks in the MyApp embedded product. You must add the scope search path to the target:

 $(CONFIGURATION_TEMP_DIR)/MyApp.build/DerivedSources 
0
source share

All Articles