Need to install Xcode Command Line Tools? You’re probably here because you ran git, clang, or another development command and got an error saying the command wasn’t found. The command line tools are essential for iOS development, even if you’re not using the full Xcode IDE.

Here’s how to get them installed quickly.

The fastest way is using Terminal. Open Terminal and run:

xcode-select --install

This triggers a popup dialog asking if you want to install the command line developer tools. Click “Install” and wait for the download to complete.

The installation can takes 5-10 minutes depending on your internet connection.

Verify Installation

Check if the tools installed correctly:

xcode-select -p

You should see something like:

/Applications/Xcode.app/Contents/Developer

Or if you only have command line tools (no full Xcode):

/Library/Developer/CommandLineTools

Test that git and clang work:

git --version
clang --version

Common Issues and Fixes

“xcode-select: command not found”

This usually means you’re on an older macOS version. Download the command line tools directly from Apple Developer portal instead.

“Can’t install the software because it is not currently available”

This error happens when Apple’s servers are busy or you have a network issue. Try these fixes:

  1. Reset xcode-select path:

    sudo xcode-select --reset
    
  2. Clear existing installations:

    sudo rm -rf /Library/Developer/CommandLineTools
    xcode-select --install
    
  3. Manual download: Go to developer.apple.com and download “Command Line Tools for Xcode” manually.

“Active developer directory not found”

If you see this error, reset the developer directory:

sudo xcode-select --reset

Then reinstall:

xcode-select --install

Alternative: Install Full Xcode

If you need the full Xcode IDE (for Interface Builder, Simulator, etc.), you have a few options:

Option 1: App Store (Simplest)

Install Xcode from the App Store. The command line tools come bundled with it.

For better version management, use Xcodes.app. It lets you:

  • Install multiple Xcode versions side-by-side
  • Download faster than the App Store
  • Manage command line tools for each version

Download it from the website or install via Homebrew:

brew install --cask xcodes

After installing Xcode via either method, set it as your active developer directory:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

That’s it. You should now have working command line tools for iOS development and programming on macOS.