When I add a test target that needs a host application in order to run Xcode adds targets that are not associated with the application I added.
I have two schemes (internal & production). I want to run tests on our internal application. When I add the internal application as a host I end up with the production target being added to builds and cannot delete it. If I remove the host application this goes away but the tests also fail.
Does anyone know where I'm going wrong?
We had the same problems, we fixed them with these steps:
in your testing target, go to the tab 'General' and set the hosting application to 'none', then go to 'Build phases' and remove the target dependency on the former hosting target.
(don't know if this step is necessary) go to 'Window'->'Projects', remove Derived Data from the hosting target and close Xcode. Reopen Xcode again, open your project/workspace.
edit your hosting target's scheme, select "Build" on the left and uncheck "Find Implicit Dependencies" - I believe that this function is somewhat buggy.
in your testing target, go to the tab 'General' and set the hosting application back to its previous value, recheck the target depdencies.