Will the three commands

  1. sudo rm -fr /Applications/Xcode.app/
  2. sudo rm -fr /Library/Developer/
  3. rm -fr ~/Library/Developer/

completely and safely discard the development environment on macOS for a once-a-decade start-from-fresh-during-major-release upgrade of macOS?


Rather than delete, I renamed the folders in question. The folders have been refilled just fine during update to Big Sur, but renaming, and hence presumably also deleting, is problematic. I am now in an infinite loop of getting the messages "An update is available for your Mac", "Command Line Tools for Xcode 12.4". Yet after clicking "Update Now" and waiting for its completion, the message returns, and another update proceeds, downloading seemingly from scratch.

Update 2

Although /usr/bin/git --version says xcodebuild: error: SDK "macosx10.15" cannot be located., git: error: .. failed, and xcode-select: Failed to locate 'git', requesting installation of command line developer tools., running sudo /usr/bin/git --version runs fine (and reports git version 2.24.3 (Apple Git-128)).

The problem then appears to be that after renaming (and even now that I've restored the renaming) the license agreement is marked as not signed, but git doesn't say so.

Update 3

(Re-)Agreeing to the license agreement from the Terminal by running sudo xcodebuild -license does not help. /usr/bin/git still says "macosx10.15" cannot be located. and xcode-select: Failed to locate 'git'.

And agreeing under the sudo identity is indeed necessary. Attempting xcodebuild -license gives Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.

  • 1
    The question starts to be all over the place with these edits, they also seem to invalidate some of the existing answers. Can you focus the question one one issue (and maybe ask additonal questions separately)?
    – nohillside
    Commented Feb 12, 2021 at 14:50
  • @nohillside Noted. You're right, of course. Will clean. First I need to understand a bit more, or at least get going. Help in this regard, even if, especially if, I am presently lost, is appreciated.
    – Calaf
    Commented Feb 12, 2021 at 14:52

2 Answers 2


No, I wouldn't recommend using that method. At the same time, you're risking deleting too much, and not actually deleting the whole thing.

For quite some time now, Xcode can actually be uninstalled simply by dragging the Xcode app from the Applications folder and into the Trash. This will quite significantly delete most of its footprint.

On older systems, you could also open a Terminal and run the following command to uninstall Xcode developer tools:

sudo /Developer/Library/uninstall-devtools –mode=all

These days, yes (almost). Xcode has been self-contained for years and you’ve got most of the directories. The only bits you’re missing are com.apple.dt.* files in:

  • ~/Library/Preferences
  • /Library/LaunchDaemons
  • /Library/PrivilegedHelperTools

You must log in to answer this question.

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