1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

Installing Xcode on Mac OS X

PDFPrintE-mail

There are two forms of Xcode, one for developing both Mac OS X and iPhone applications and the other solely for developing Mac OS X applications. In order to download Xcode, you will need either a Registered iPhone Developer account (in the case of the iphone Xcode) or an ADC membership (in the case of the Mac OS X Xcode). Fortunately, both of these memberships are free and can be activated using your existing Apple account (for example the one you use to buy music on iTunes).

 

Once you have registered, you will gain access to the Apple Developer Connection web site where download links are provided for Xcode on a variety of Mac OS X versions.

The download is over 2GB in size and will take a number of hours to complete depending on the speed of your internet connection. The package takes the form of a disk image (.dmg) file. Once the download has completed, a new window will open as follows displaying the contents of the .dmg file:

 

The iPhone SDK .dmg contents

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If this window does not open by default, it can be opened by clicking on the SDK disk drive icon on the desktop.

Initiate the installation by double clicking on the package icon (the one that looks like an opening box) and follow the instructions until you reach the Custom Install screen:

 

Selecting the iPhone SDK components to install

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The default selections on this screen are adequate for most requirements so unless you have specific needs there is no need to alter these selections. Continue to the next screen, review the information and click Install to begin the installation. Note that you may first be prompted to enter your password as a security precaution. The duration of the installation process will vary depending on the speed and current load on the computer, but typically completes in 15 - 30 minutes.

Starting Xcode

Having successfully installed the SDK and Xcode, the next step is to launch it so that we can write and then compile a sample Objective-C application. To start up Xcode, open the Finder, click the Macintosh HD device in the left had panel then double click on the Developer folder, followed by the Applications folder. Within this folder you should see an icon for Xcode. Double click on this icon to launch the tool. Once Xcode has loaded, and assuming this is the first time you have used Xcode on this system, you will be presented with the Welcome screen. On this screen, click on the option to Create your first Cocoa application to proceed to the developer documentation screen.

 

Starting a New Project

Each application created in Xcode is contained within a project. The first step in developing an application, therefore, is to create a new project. This is achieved by selecting the File -> New Project... menu option. The New Project window provides a range of different types of Mac OS applications that can be created. If you downloaded and installed the iPhone version of the SDK.

 

 

Creating a new Xcode project

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Configure the project type, perform the following steps:

  • Under the Mac OS X section, scroll down the list and select Command Line Utility.
  • In the main panel, choose Foundation Tool then click on the Choose.. button.
  • In the resulting panel, enter sampleApp in the Save As: field.
By default, Xcode will put the project files in your Documents folder so be sure to create or specify a specific folder for your Objective-C development work before proceeding. Once you have defined a name and location for your project click the Save button to continue. Xcode will subsequently create the new project and open the main Xcode window:

The main Xcode window