Many small macOS scripts and developer utilities rely on Apple’s Command-Line Tools for Xcode package. Among other things, it ships:
git
,svn
, and other version-control binariesclang
& friends for compiling C/C++/Obj-Cmake
,ld
,strip
,ar
,nm
, …SetFile
,PlistBuddy
, and dozens of helper tools used in shell scripts
If you ever tried to run git
on a fresh Mac and saw a dialog asking to “Install Command Line Developer Tools”, this is what macOS was talking about. Below are three quick ways to get them.
Time required: ? 2 – 3 minutes on a fast connection (700 MB download). No Apple-ID sign-in needed unless you prefer the full Xcode route.
1. One-liner in Terminal (fastest)
- Open Terminal.app (? Space ? Terminal).
- Run:
xcode-select --install
- A small dialog appears – click Install and accept the license.
That’s it. After the installer finishes you can verify with:
xcode-select -p # ? /Library/Developer/CommandLineTools
clang --version # should print Apple clang …
2. Via the full Xcode app (App Store)
Installing the full 20 GB Xcode bundle also drops the command-line tools on your system. Choose this path only if you plan to use the Xcode IDE.
- Open the App Store and search for Xcode.
- Click Get / Install (Apple-ID required).
- Once Xcode finishes downloading, open it once so it can install its components.
- Verify:
xcode-select -p # ? /Applications/Xcode.app/Contents/Developer
3. Manual .pkg
download (offline machines)
Apple hosts standalone installer packages on the Developer website:
- Sign in at https://developer.apple.com/download/all/?q=command line tools (free account).
- Download the DMG that matches your macOS version, e.g. Command Line Tools for Xcode 15.3.
- Mount the DMG and double-click the .pkg inside.
Accepting the license non-interactively
Scripting a fleet of Macs? After installation run:
sudo xcodebuild -license accept
This pre-accepts the license so build systems won’t hang waiting for T&C confirmation.
Uninstalling (rarely needed)
To remove the standalone tools:
sudo rm -rf /Library/Developer/CommandLineTools
Then reinstall with xcode-select --install
whenever you need them again.
?? Do not delete if they live inside
Xcode.app
– use Launchpad or Finder->Applications to remove Xcode instead.
Troubleshooting
• “Command line tools are already installed, use Software Update to install updates.” – They’re present; run softwareupdate -l
to check for newer versions.
• xcode-select: error: command line tools are already installed, use Software Update to install
– same as above.
• git: command not found
even after installing – Open a new Terminal window or run hash -r
to refresh your shell’s path cache.
Wrap-up
You now have Apple’s developer toolkit on your Mac. Most of the scripts in this repo (including the Hide Logic Extension helper) will “just work” from here on.