Installing the Xcode Command Line Tools on a Mac
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.
Contents
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.
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:
- Start Xcode.
- Choose Preferences from the Xcode menu.
- On the Locations window, check the Command Line Tools option that shows the Xcode version with which the Command Line Tools were installed.
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:
- Go to https://developer.apple.com/download/all/ and sign in.
- Search for the Command Line Tools version you want to download.
- Click the View Details button and download the
.dmg
file.