The key step being number 5 below…
1. Boot into a partition with the Mac OS X v10.5.6 or later installed.
2. Download the iPhone SDK DVD software.
3. Double-click on iPhone SDK.
4. Follow the instructions in the Installer.
5. To install Xcode 3.1.3 in a directory other than the default /Developer, you
must specify a new <Xcode> directory name on the “Custom Install” pane
⁃ Select the folder icon under “Location” next to the “Developer Tools
Essentials” package name.
⁃ Select “Other…” at the top of the pop-up.
⁃ Navigate to the location for the new <Xcode> folder. Select “New Folder”.
⁃ Enter a folder name in the “New Folder” window; e.g. Xcode3.1.3. Select
⁃ Finally, select “Choose” in the “Install Xcode Tools” pane.
6. Authenticate as the administrative user. The ﬁrst user you create when sMac OS X has administrator privileges by default.