Installing the Xcode Command Line Tools on a Mac

From RAD Studio
Jump to: navigation, search

Go Up to MacOS Application Development

Go Up to iOS Mobile Application Development

Go Up to iOS Mobile Help Wizard


Xcode Command Line Tools is a self-contained package Apple provides for developing macOS and iOS applications. They offer a way to perform development tasks from the command line using UNIX-style commands without requiring Xcode IDE.

Checking if the Xcode Command Line Tools are installed

Before installing Xcode Command Line Tools, check if they are already installed on your macOS. An easy way to do this is by opening the Terminal application and running any recognized command line tool, like gcc.

If Xcode Command Line Tools is not installed, macOS will prompt you to install it.

Xcode command line tools install prompt.png

Checking the Xcode Command Line Tools version

Since Xcode 6.1, Xcode Command Line Tools are bundled with Xcode. So, if you have a recent version of Xcode, you can check what version of Xcode Command Line Tools you have by doing this:

  1. Start Xcode.
  2. Choose Preferences from the Xcode menu.
    Xcode menu, Preferences.png
  3. On the Locations window, check the Command Line Tools option that shows the Xcode version with which the Command Line Tools were installed.
    Xcode Locations window command line version.png

A way to check the version of Xcode Command Line Tools without requiring Xcode is by running the following command in the Terminal:

xcode-select --version 

Installing the Xcode Command Line Tools

One option is to install Xcode, as since version 6.1, it includes Xcode Command Line Tools.

But if you only want the Xcode Command Line Tools, you can install a self-contained version either way:

  • By running any recognized command line tool in the Terminal application, like gcc, and clicking Install on the prompt window.
  • From the web:
  1. Go to https://developer.apple.com/download/all/ and sign in.
  2. Search for the Command Line Tools version you want to download.
  3. Click the View Details button and download the .dmg file.

Next

See Also