Xcode 6.4 Swift Unit Test Cannot compile: "GPUImage.h not found" "failed to import bridge header"

My Xcode project builds and works great . It has Swift code and Objective-C.

He has installed GPUImage.

I added a unit test to it, and now it will no longer compile:

GPUImage.h file not found

Failed to import bridge header

Here are the workarounds that I found and tried:

This question seems to have the same problem: added target device for testing on xcode - failed to import the bridge header will not disappear

If you know why Xcode cannot find my BridgingHeader.h or GPUImage.h, then please share. I am trying to get Unit Testing to work with Travis CI, but cannot go through the compilation stage.

+6
source share
1 answer

Xcodebuild does not support test targets and application tests. I would try xctool , which is a good alternative to Xcodebuild and makes testing iOS and OSX applications easier. Travis CI comes with a preinstalled version.

To install it locally on your computer, you can use homebrew.

 update brew brew install xctool 

You can use the following command to create the code. Its structure is identical to Xcodebuild .

 xctool test -workspace MyExampleProject.xcworkspace -scheme MyExampleTests -sdk iphonesimulator 

To run it on Travis CI, add the following code to .travis.yml

 language: objective-c script: - xctool -workspace MyExampleProject.xcworkspace -scheme MyExampleProject -sdk iphonesimulator - xctool test -workspace MyExampleProject.xcworkspace -scheme MyExampleProjectTests -sdk iphonesimulator 
+1
source

All Articles