Build the toolchain

Install and verify Apple command-line tools

Install Apple command-line tools only when needed, then verify the selected directory and compiler instead of trusting the installer dialog.

10 minute lesson

~~~

The Command Line Tools package provides compilers, SDK utilities, Git, and related development commands — without the full Xcode application. For most web and backend work it is all the Apple tooling you need, and Homebrew requires it before it will install anything.

You don’t need to download anything manually. Start the Apple installer from Terminal:

xcode-select --install

macOS opens a dialog, downloads the package, and installs it. The command may instead report that the tools are already installed:

xcode-select: note: Command line tools are already installed.
Use "Software Update" in System Settings or the softwareupdate command to install updates

That message is a result, not an error. It means you can move straight to verification.

Verify, don’t trust the dialog

The installer dialog saying “done” is weak evidence. Verify the result with xcode-select --print-path and xcrun --find clang:

xcode-select --print-path
# /Library/Developer/CommandLineTools
xcrun --find clang
# /Library/Developer/CommandLineTools/usr/bin/clang
git --version
# git version 2.50.1 (Apple Git-155)

Three healthy signs: the selected directory exists, the compiler resolves inside it, and Git answers. If you run git or clang on a Mac without the tools, macOS itself offers to install the package — that prompt is this same installer wearing a different hat.

After updates, verify before reinstalling

macOS upgrades occasionally leave the tools broken or removed while the selection still points at them. The symptom is invalid active developer path on the first git command after the update.

After a macOS or Xcode update, repeat the verification before reinstalling anything. A missing selection and a missing package are different problems: a missing package needs xcode-select --install again, while a missing selection needs sudo xcode-select --reset. Reinstalling a multi-gigabyte package to fix a one-line selection problem is the classic time waster here.

Once the three verification commands pass, record their output in your setup notes. That snapshot is what you will compare against when a native build fails months from now.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →