I have a few projects I\'m trying to build with Xcode 6 Beta 2. The projects all have some type of library that uses XCTest (Kiwi/XCTest and Specta) that don\'t build in Xco
I have faced same issue after some time I have imported XCTest framework from build phases and solved the issue.
Build phases-> XCTest.Framework>clean and run. I hope it will be helpful to some one..
for your reference...Import XCTest in to existing project
The best way to have an XCTest is to add it from the Test Navigator (5th icon in the left pane).
Acting so, the new xx.m
test file doesn't target (in the right pane) an app (in the left pane > Target, Wrapper Extension : app), but a bundle (Wrapper Extension: xctest)
'XCTest/XCTest.h' file not found
, it's because your file had got to target an app.This is the easiest work-around I've found. No project changes are necessary. And this change will persist until your next Xcode upgrade:
cd /Applications/Xcode6-Beta7.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Developer/Library/Frameworks
ln -s ../../../../../Library/Frameworks/XCTest.framework
Note: This may not be needed for any projects created in Xcode 7.
CocoaPods had a fix for this here and here
In order to fix this for any CocoaPod dependencies you need to add the following to FRAMEWORK_SEARCH_PATHS
in any Pod target that requires XCTest (e.g. Kiwi, Specta, FBSnapshotTestCase, etc).
$(PLATFORM_DIR)/Developer/Library/Frameworks
This will allow you to reference XCTest in any dependencies you may have. This may be fixed in a future update of CocoaPods, or the Pod you are referencing, so you may want to remove it later.
It is not detrimental to earlier versions of Xcode so should be safe to use.