To uninstall the Xcode Command Line Tools (CLT) from your Mac, you must manually delete the installation directory using the terminal, as Apple does not provide a built-in uninstaller.
Before deleting, confirm where the tools are installed on your system. Run this command in Terminal:
xcode-select -p # output: /Library/Developer/CommandLineTools- Important: If the output shows /Applications/Xcode.app/Contents/Developer, you have the full Xcode app installed, and the tools are bundled within it. Deleting the folder below may not be necessary unless you specifically installed the standalone CLT package.
Execute the following command to remove the entire CLT directory. (You will be prompted to enter your macOS administrator password)
sudo rm -rf /Library/Developer/CommandLineToolsAfter deleting the folder, reset the active developer directory to ensure the system doesn't continue looking for tools in a location that no longer exists: [2]
sudo xcode-select -rConfirm that the tools are gone by running the version check again. You should receive an error stating that the active developer directory cannot be found:
xcode-select -p # xcode-select: error: Unable to get active developer dir...If macOS still prompts you to update "Command Line Tools" even after removal, you may need to delete lingering receipt files.
This often requires temporarily disabling System Integrity Protection (SIP) or using Recovery Mode: [2]
- Boot into Recovery Mode (hold Power button on M1/M2/M3 or Cmd + R on Intel).
- Open Terminal from the Utilities menu.
- Navigate to the receipts folder and remove the relevant files:
(Note: Your drive name may differ from "Macintosh HD").
cd /Volumes/Macintosh\ HD/Library/Apple/System/Library/Receipts rm -rf com.apple.pkg.CLTools*
- Restart your Mac normally.