How to install the Xcode Command Line Tools on macOS - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

How to install the Xcode Command Line Tools on macOS
====================================================

### [\#CommandLine](https://rocketeersapp.com/knowledge/command-line)

Install the Xcode Command Line Tools on macOS to get git, clang, make and more, plus how to verify, reset, and reinstall them.

 Published by [Mark van Eijk](https://rocketeersapp.com/author/mark-van-eijk) on June 23, 2026 · 2 minute read

1. [Why you need the Command Line Tools](#content-why-you-need-the-command-line-tools)
2. [Installing the tools](#content-installing-the-tools)
3. [Verifying the install](#content-verifying-the-install)
4. [What you get](#content-what-you-get)
5. [Resetting and reinstalling](#content-resetting-and-reinstalling)
6. [Next steps](#content-next-steps)

[\#](#content-why-you-need-the-command-line-tools "Permalink")Why you need the Command Line Tools
-------------------------------------------------------------------------------------------------

On a fresh Mac, most developer tooling won't work until you install the Xcode Command Line Tools. This is a lightweight package (you don't need the full multi-gigabyte Xcode app) that gives you the compilers and utilities everything else builds on: `git`, `clang`, `make`, `gcc`, header files, and more. It's also a hard prerequisite for Homebrew and countless other dev tools.

[\#](#content-installing-the-tools "Permalink")Installing the tools
-------------------------------------------------------------------

There's one command to remember:

 ```
xcode-select --install

```

This pops up a small dialog asking you to confirm. Click **Install**, agree to the license, and macOS downloads and installs the package for you. It takes a few minutes depending on your connection.

If the tools are already installed, you'll see a message saying so, which is harmless.

[\#](#content-verifying-the-install "Permalink")Verifying the install
---------------------------------------------------------------------

Once it finishes, confirm where the tools live with `-p` (print path):

 ```
xcode-select -p

```

You should get something like `/Library/Developer/CommandLineTools`. To check the individual binaries are on your `PATH`, ask them for their versions:

 ```
git --version
gcc --version
clang --version
make --version

```

Each should print a version string. On macOS, `gcc` is actually a wrapper around Apple's `clang`, so don't be surprised if `gcc --version` mentions clang.

[\#](#content-what-you-get "Permalink")What you get
---------------------------------------------------

Beyond the headline tools, the package bundles the C/C++ toolchain, `make`, `git`, `svn`, the linker, and the system headers that native extensions compile against. This is why installing Node modules with native bindings, Ruby gems, or Python packages with C extensions all "just work" afterwards.

[\#](#content-resetting-and-reinstalling "Permalink")Resetting and reinstalling
-------------------------------------------------------------------------------

Sometimes a macOS upgrade leaves the tools in a confused state and you get errors like `tool 'xcodebuild' requires Xcode`. The first thing I try is resetting the active developer directory:

 ```
sudo xcode-select --reset

```

That points `xcode-select` back at the default location. If the tools are genuinely broken or missing, remove and reinstall them. Delete the folder, then run the installer again:

 ```
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

```

The `rm -rf` here is safe because that directory is owned entirely by the tools package; reinstalling recreates it cleanly.

[\#](#content-next-steps "Permalink")Next steps
-----------------------------------------------

With the Command Line Tools in place, you've got a working compiler and `git` out of the box. From here the usual next move is installing Homebrew, which depends on exactly these tools, and from there the rest of your stack. If you run into a "command not found" after install, open a new terminal window so it picks up the updated environment.

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#CommandLine](https://rocketeersapp.com/knowledge/command-line)

- [Argument list too long (Bash: /bin/rm)](https://rocketeersapp.com/knowledge/argument-list-too-long)
- [How to install Composer packages locally](https://rocketeersapp.com/knowledge/install-composer-packages-locally)
- [How to send GET and POST requests with curl](https://rocketeersapp.com/knowledge/curl-post-get-api-requests)
- [Essential Linux command line basics for developers](https://rocketeersapp.com/knowledge/linux-command-line-basics)
- [How to search file contents with grep](https://rocketeersapp.com/knowledge/search-files-grep-command)
- [The complete guide to the curl command](https://rocketeersapp.com/knowledge/curl-command-complete-guide)

 [View all 21 articles →](https://rocketeersapp.com/knowledge/command-line)
