Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For iOS projects in Xcode, why is the test target set to build by default on Run?

We were running into issues trying to add a test target to a project we inherited. The test target was working, however Running the app would always fail due to an error in the test target. We were puzzled by this and eventually found a boolean setting in the scheme that was on by default:

enter image description here

In the image, I unchecked it, but the test target for Run had a checkmark in it. Removing the checkmark made everything work again.

Why would Apple want Running your application to build your tests also? This makes us think there might be consequences we should be aware of.

like image 768
abc123 Avatar asked Mar 03 '15 18:03

abc123


1 Answers

The problem, judging by your screen shot, is that this scheme uses the QA configuration for the Run action, whereas it uses the Debug configuration for the Test action. Thus, things work one way when you do a Test build and a different way when you do a Run build.

like image 188
matt Avatar answered Oct 27 '22 06:10

matt