Xcode Installation Basics

Beginning in Mac OS X v10.5, Xcode supports installing multiple versions of the Xcode developer tools. When installing, the default location for the Xcode developer tools continues to be /Developer; however, you can install Xcode developer tools to any other directory or volume, including external drives. The Xcode directory can also be named something other than Developer. As with previous releases, the subdirectory hierarchy inside the installed Xcode directory should not be altered or rearranged.

Installing Xcode on a Macintosh computer is an easy affair: just run the Xcode Tools installer. You can install more than one release of Xcode, which provides you with one or more Xcode environments. You can take advantage of multiple Xcode environments to work on projects using a release of Xcode other than the release you typically use, or to run a test build of a future release of Xcode.

After installing Xcode, the essential Xcode tools are contained in a single directory, known as the <Xcode> directory. By default, the Xcode Tools installer sets /Developer as the <Xcode> directory, but users can choose a different location for this directory.

The Xcode Tools Disk

The Xcode Tools disk packages a set of applications, command-line tools, SDKs, and other resources used to develop software that runs on Mac OS X.

Figure 1-1  Xcode Tools disk
Xcode Tools diskXcode Tools disk

The Xcode Tools disk includes a set of UNIX developer tools, which include GCC, GDB and others. An Xcode installation contains a <Xcode>/usr directory with these tools. To support traditional UNIX-based development, you have the option of installing a second set of the UNIX developer tools in /usr. By default, this option is selected. You can also modify your shell environment to use the Xcode-provided UNIX tools.

You can customize one of all the Xcode environments on your computer by moving files between the file-system locations Xcode programs look in when searching for development resources. For example, instead of having the ADC Core Reference Library documentation set on all the Xcode releases on a computer, you can move it to your home directory or the local domain of your file system to save space.

Xcode Tools Installer

The Xcode Tools installer gives you all the options you need when installing and obviates the need to install content from individual packages. The installation choices in the "Custom Install..." panel have been organized into six groups, as shown in Figure 1-2.

Figure 1-2  Xcode Tools installer
Xcode Tools installerXcode Tools installer

The first group, Developer Tools Essentials, is always installed; the remaining groups are optional. The list that follows explains what each group contains and where it is stored.

Installation Instructions

To install the Xcode 3.0 Developer Tools using the Mac OS X v10.5 (Leopard) DVD:

  1. Boot into a partition with Mac OS X v10.5 (Leopard) installed.

  2. Insert the Mac OS X v10.5 (Leopard) Install DVD.

  3. Double-click the file XcodeTools.mpkg, located inside the directory Optional Installs/Xcode Tools.

  4. Follow the instructions in the Installer. The Installer provides several options:

    • If you want to install Xcode Tools in a different directory, or if you want to install Xcode Tools in the standard /Developer directory on a different volume, you must select Customize. Then choose a new location from the Location menu item for Developer Tools Essentials.

    • If you want to install Mac OS X 10.3.9 Support or WebObjects, you must select Customize and check those install groups.

  5. Authenticate as the administrative user. The first user you create when setting up Mac OS X has administrator privileges by default.

Once you have installed the Xcode developer tools, you can access the documentation by launching Xcode and choosing any of the items in the Help menu. Developer applications such as Xcode, Instruments, and Interface Builder are installed in <Xcode>/Applications.

The Xcode Tools Uninstaller

Because the Xcode Tools installer places files across several file-system domains, when you need to uninstall Xcode you should run its uninstall script. To uninstall an Xcode release, you must run the uninstall-devtools script, located in <Xcode>/Library. The script accepts one argument, --mode. Its value depends on what install groups you want to uninstall.

For example, to remove the Developer Tools System Components file as well as the <Xcode> directory, run these commands:

sudo <Xcode>/Library/uninstall-devtools --mode=systemsupport
sudo <Xcode>/Library/uninstall-devtools --mode=xcodedir

Note that the uninstall-devtools script removes only the directories listed in Table 2-2. You must manually remove other directories Xcode may use, such as ~/Library/Developer/Xcode_3.0.