Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Apple’s developer tools installed on my Mac and there is some linking weirdness that is preventing some of the binaries from running. The problem was not solved by reinstalling Xcode and its command-line tools, either the public version 4 or the developer-preview version 5. How can I completely delete the command-line tools in preparation for reinstalling them cleanly?

share|improve this question
How are you uninstalling Xcode exactly? – Ramhound Aug 29 '13 at 15:08
@Ramhound That’s my question. It’s possible to “uninstall” Xcode by dragging to the trash, but that doesn’t touch any of the command-line tools. – bdesham Aug 29 '13 at 15:35
up vote 4 down vote accepted

As stated by Cocoanetics here, you can use this script to remove the tools completely:


if [ ! -f "$RECEIPT_FILE" ]
  echo "Command Line Tools not installed."
  exit 1

echo "Command Line Tools installed, removing ..."

# Need to be at root
cd /

# Remove files and dirs mentioned in the "Bill of Materials" (BOM)
lsbom -fls $RECEIPT_FILE | sudo xargs -I{} rm -r "{}"

# remove the receipt

# remove the plist

echo "Done! Please restart XCode to have Command Line Tools appear as uninstalled."

Pay attention to the disclaimer right under the script on that page:

Use at your own risk, it might remove more than you bargained for. So make sure you made a time machine backup before running this.

share|improve this answer
Though the .bom and .plist files are named differently on OS X 10.10, this approach worked fine on Yosemite, too, to uninstall the command line tools installed by invoking "git". – Thomas S. Dec 3 '14 at 8:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .