XCTest: the package “target tests” could not be downloaded because its executable file could not be located

I am using Xcode 6.2, and I have a project with several goals and no tests.

I am trying to enable XCTest for one of the purposes. To do this, I add a new “Cocoa Touch Testing Bundle” and select the target that I want as a host.

When you try to run the test using Cmd + U, running the simulator opens the application for a few milliseconds, and then it closes by running this message:

IDEBundleInjection.c: Error 4 downloading the package "/ Users / Pepito / Library / Developer / Xcode / DerivedData / Flight-gpauuftblwwxtvevnylzllkypkjy / Build / Products / Debug-iphonesimulator / target Tests.xctest ': the package" Target Tests "could not be downloaded, because its executable file cannot be located.

When I check the folder indicated there, there is only the Info.plist file, but there is no executable file.

I tried to add a new application branch that automatically added tests for it. The same error occurs when trying to run tests.

If I create tests for the target in a new Xcode project, then it works fine.

+5
source share
3 answers

I finally managed to solve the problem. This was due to the default compiler for the XCTest target. He selected “Unsupported Compiler” and I switched to “Default Compiler (Apple LLVM 6.1)” and it started working again. enter image description here

+1
source

I got this error today because I forgot to add sources to the "Compile Sources" build phase for my test purpose.

+6
source

In my case, the goal of the iOS Deployment Target in Build Settings was lower than the version of the target device. Hope that helps someone.

0
source

All Articles