Build An App In Xcode

Building an app in Xcode means compiling all the source code files in the project. It’s really exciting to see what you get when you build and run a project that you created from a template. Building and running an app is relatively simple; just follow these steps:

In the Flow Controls section of the toolbar, choose a scheme from the Scheme pop-up menu.

A scheme tells Xcode the purpose of the built product. The schemes in the Scheme pop-up menu specify which targets (actual products) to build, what build configuration to use when building them, which debugger to use when testing them, and which executable to launch when running them on the device or Simulator.

Xcode automatically creates several schemes with configurations for you, and you can create more schemes and edit any of the schemes.

To work with the RoadTrip example app, you just want to make sure that the scheme is set either to the Simulator or the device and that the proper SDK has been selected. Remember that when you download an SDK, you actually download multiple SDKs — a Simulator SDK and a device SDK for each of the current iOS releases.

You should use the Simulator SDK for iOS 6.0 (as of this writing) for apps that you want to submit to the App Store — until a newer version of iOS is released.

It’s possible to switch to the device SDK and transfer your app to a real-world iOS device. But before you do that, you need to be a card-carrying member of the iOS Developer Program. (Only members can run an app on a device, even on your very own iPhone or iPad.) Go to the iOS Dev Center to learn about enrolling in the program if you haven’t done so already.

Choose Product→Run from the main menu to build and run the application.

You can also click the Run button in the top-left corner of the Workspace window. The Activity viewer tells you all about the build progress, flags any build errors (such as compiler errors) or warnings, and (oh, yeah) tells you whether the build was successful.

This figure shows you what you’ll see in the Simulator (in the Portrait mode), and then you tap the Master button. It’s not much to look at, but it’s a start — and it is a functioning iPad app.

If you rotate the Simulator by choosing Hardware→Rotate Left, in the Simulator menu, you see a nice Split view (as shown in this figure).