Help Topic: Installing XCode and Enabling Command Line Tools


Maintained by: mikerb@mit.edu         Get PDF


Installing XCode and Enabling Command Line Tools


This page concerns getting XCode on your Mac. It contains components, like the C++ compiler, that will be essential for our purposes, so we'll need to make sure it's installed on your machine. On your machine, it's possible that:

  • XCode is properly installed but you just don't know it,
  • XCode is not at all on your machine.

If you have a Mac provide by the 2.680 staff, and have just created your own user account, the most likely scenario is the first one. In any event, we'll soon find out.

Checking if XCode is already installed (using Finder)    [top]


Finder is the Mac application that is running constantly and by default upon login. To switch over to running Finder, just click anywhere in the screen background outside an app. We'll use Finder to find out if XCode is installed.

  • In Finder, select the Go pull-down menu, and select Applications. Or just use the short-cut key Command-Shift-A while Finder is active.
  • This should open a new Finder window, showing all the Applications installed on your machine. Look for the XCode icon in the Applications folder. It is blue and has a little hammer. It should look something like:

Figure 1.1: The Finder window, showing the XCode application, should look something like this.

After double-clicking on the XCode icon above, the XCode splash window should appear, looking something like:

Figure 1.2: The XCode splash window typically will open when you launch XCode.

If you successfully found and launched XCode, go directly to the Section "Updating XCode".

If you did not find XCode on your system, proceed to the following Section "Installing XCode".

Installing XCode    [top]


XCode is distributed by Apple. It is free but Apple wants you to sign up as a developer to have access to XCode. This can be done anonymously, but you have to do the following steps:

  • Obtain XCode from the App Store. Even though it's free, this is still the way to install it on your computer. To access the App Store, you obviously will need to have a network connection.

You can go to the App Store by clicking on the main Apple Menu at the very top left of your screen, and selecing App Store. You can also get there by selecting the App Store icon in your Dock if it is there. The icon should look like:

Figure 1.3: The App Store icon.

  • Once you have launched the App Store, search on the term "XCode". You should see something like:

Figure 1.4: The XCode Application is found on the App Store.

Presumably the button next to XCode will say "GET", but it may say "UPDATE" or "OPEN" if in fact it somehow was installed but ecaped our attention when we were looking for it previously. If it says "GET" or "UPDATE", click on the button and go through the steps to download or update the software. Once you are done, or if the button said "OPEN", proceed to the section "Installing the XCode Command Line Utilities".

Updating XCode    [top]


Even if XCode is installed on your machine already, we want to (a) check if it needs to be updated, (b) install the command line utilities. If you just now installed XCode as in the previous section, you can skip this step and proceed to the Section "Installing the XCode Command Line Utilities".

We check for available updates first since, if a new update is indeed applied, the command line utilities may need to be re-installed anyway. Note, some people may have their system configured to apply updates automatically. But if you don't you need to periodically check to see if updates are available and decide if the current moment allows for the disruption of downloading and applying updates.

To check if an update is available for XCode, select the main Apple pull-down menu from the upper-left corner of your screen. It may show something like:

Figure 1.5: The Apple pull-down menu shows that there are currently 6 applications that need to be update.

In the above case, there are 6 applications from the App Store (XCode is obtained through the Apple App Store), that have updates available. Select this menu item, and a window like the following should appear.

Figure 1.6: In this case XCode is listed as needing an update.

If you see XCode in the list of apps that need to be updated, as above, go ahead and select it by clicking on the UPDATE button and following the instructions.

Installing the XCode Command Line Utilities    [top]


XCode is quite large and there are a number of optional components that may not be installed by default. One of these is the Command Line Utilities. We will install this from the command line with:

 $ xcode-select --install

Follow the instructions presented to you either on the command line, or in a pop-up window. It may prompt you for your password.

You should now have a pretty powerful developer environment ready to go!


Page built from LaTeX source using texwiki, developed at MIT. Errata to issues@moos-ivp.org. Get PDF