I want to start tests under Xcode 8 and it fail in the beginning. My error is:
Could not determine bundle identifier for MyProjectTest\'s TEST_HOST:
It seems there are several bugs in Xcode8 that can cause this. However I have found a solution for the case where Xcode tries to find the TEST_HOST app within the Intermediates/CodeCoverage/ folder. (I tried all other solutions with the module names etc and it didn't work for me.)
The issue itself seems to be that Xcode does not even try to build the app before running the tests. However once Xcode is able to find the TEST_HOST in the folder it will rebuild when launching the tests. That's how we can find our way around it.
Two possible solutions:
If you don't have to have code coverage:
Go to your unit test target's Build Settings and set Enable Code Coverage Support to No and deactivate code coverage in your build scheme's test setting. (Edit scheme, select Test on the left). If you want to run your unit tests and still get that TEST_HOST error message, try building (CMD+B) or running your app. Then you can run your tests without that error. Voilá.
If you need code coverage:
You can follow a certain workaround to get that Intermediates/CodeCoverage/.. folder filled. Once the app is inside Xcode will rebuild for the unit tests as it should, but you need to get it filled once. This is how you do it:
I know, it's bothersome. But it's the only solution to the problem so far.