Take the 2-minute tour ×

I have seen a lot of things about 'targets' while working with xcode. when i click on the project icon (blue, in xcode 4.2) i see 'Targets' in the middle pane with my file name under it.

What does that mean? and can I add more 'targets' to my project? If yes, what would that mean?

I have this: http://developer.apple.com/library/ios/#featuredarticles/XcodeConcepts/Concept-Targets.html

but i didn't understand a thing

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

A target basically defines what it is you are building and how you are building it. You can add more targets if you would like to build more than one thing. This usually makes sense if you need to build several related things from the same project.

For instance, you might want one target for a full, paid version of an application, and another target for a reduced, free version of an application. Both targets would include much of the same code and resources, but some of the settings would be different and you might have different files included with each.

share|improve this answer
add comment

Targets are simply different ways of building a product. You have your source files, and you have your output, and there are several ways that you can get from A to B.

An Xcode project may contain a number of source files which can be built do produce a number of different products.

For example, you could build an executable using some of the files, or you could build a library (Framework) from some of the files, or a unit test library, or with different build flags.

Most projects will have a single target, but some are more complex than others.

share|improve this answer
It's probably not a good idea to describe targets as configurations, because configurations are something different in Xcode. –  Jim Aug 21 '12 at 13:52
good point, re-worded –  Joe Aug 21 '12 at 13:54
you mention libraries. so can i add a library 'project (?) as my target, and build it? because it requires different commands, is there a different method to add a target? or is it that i can just select the files from the available files in the workspace (under the compile sources in build phases probably) but the building and execution wll follow the same command? –  neeraj Aug 21 '12 at 14:20
If you want to make a library, create a new Dynamic Library, Static Library or Framework target then add the relevant files to it. –  Joe Aug 21 '12 at 14:21
okay. now i see the 'new target..' option in file menu. So if I make a library as my target, then whenever i build and run my project as a whole, all my targets would be built and executed? –  neeraj Aug 21 '12 at 14:25
show 1 more comment

Your Answer


