Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a preferred target in Xcode?

Tags:

xcode

targets

I'm studying a simple application demo from Apple that has two (2) targets.
Each target has its own plist, storyboard and some code; with a few files shared between them.

Choosing the 'R'un, runs one default target. I want to specify what target to run.

How do I select the target to run in Xcode?

enter image description here

like image 568
Frederick C. Lee Avatar asked Apr 03 '15 17:04

Frederick C. Lee


1 Answers

If you have more than one app target, you have more than one scheme. If you have more than one scheme, you can pick a scheme from the scheme menu (at the top of the project window). Then when you run, that scheme will be what builds and runs (on the corresponding destination).

In this screen shot, I have two app targets and hence two schemes ("backgroundPlayer" and "interrupter"):

enter image description here

As you can see, "backgroundPlayer" is checked. So if I build and run now, I build and run "backgroundPlayer". But if I choose "interrupter", then it will be checked, so if I then build and run, I build and run "interrupter".

like image 167
matt Avatar answered Nov 15 '22 17:11

matt