Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode test target with host application forces wrong target into build section of scheme

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?

like image 910
Steve Avatar asked Apr 01 '15 13:04

Steve


1 Answers

We had the same problems, we fixed them with these steps:

  1. 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.

  2. (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.

  3. edit your hosting target's scheme, select "Build" on the left and uncheck "Find Implicit Dependencies" - I believe that this function is somewhat buggy.

  4. in your testing target, go to the tab 'General' and set the hosting application back to its previous value, recheck the target depdencies.

like image 80
Thomas Elstner Avatar answered Oct 22 '22 00:10

Thomas Elstner