Chapter 13. Targets

Targets are the engines of Xcode. They define the steps that will transform your source code and resource files into a finished product. Targets can be very complex or ridiculously simple. Xcode comes with targets that automatically take care of the myriad of details needed to produce standard products such as application bundles. Or you can take complete control and choose a target that abdicates all of the responsibility for building a product to you.

The purpose of a target is to produce something. Most targets produce a product. There are different types of targets, depending on what kind of product is being produced. Each target references the source files and resources required to produce its product, along with the instructions on how those source files get processed, how the product is assembled, and the order in which all of those things have to happen.

Targets appear in the Targets smart group of the project window. Most project templates come with a target already defined, appropriately configured for that project type. If you stick to developing basic applications and tools you may never need to add a target to an existing project. Nevertheless, understanding what a target is and does is a prerequisite to customizing one and is fundamental to understanding the build process as a whole.

Target Components

Targets consist of several interrelated parts: build phases, build settings, build rules, dependencies, and a product, as listed in the following table. ...

Get Beginning Xcode® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.