How to delete the entire Xcode command line tools from my mac

Back in mid-2021, I accidentally installed the Xcode command line tool package while downloading homebrew, now I want to delete it all. please read everything on this text.


i Used terminal to go to /Library/Developer/CommandLineTools
As shown after using xcode-select -p command to locate where it is located.

Now I am shown a folder taking up 900+ MB of my disk space. however, I look at the info of the files, and some of the files inside this big folder say it was created in 2018 and says the folder was "modified." on the day I accidentally installed Xcode and the command line tools in it.


Can I delete the entire Folder containing the command line tools? Will it destroy my OS?

Did my mac already have these command line tools the moment I purchased it?

Which of these files were downloaded on the day I installed homebrew?

Finally, How do I undo or delete what I installed that day I accidentally downloaded Xcode?

MacOS high sierra 10.13.6

MacBook Air 13″, macOS 10.13

Posted on Aug 22, 2022 6:14 AM

Reply
3 replies

Aug 22, 2022 6:44 AM in response to Cyflor-N-Ac

In Finder, press shift+cmd+G (Go To Folder), and copy/paste the following:


/Library/Developer


That will open a new Finder window on that location and you will see a folder named CommandLineTools. Select that specific folder and drag/drop to your Trash. This action will prompt you for your admin password as this is a privileged location. Empty the Trash when done.

Aug 23, 2022 7:59 AM in response to Cyflor-N-Ac

Can I delete the entire Folder containing the command line tools? Will it destroy my OS?


No.


Did my mac already have these command line tools the moment I purchased it?


No. CommandLine tools are installed via entering the command:

xcode-select --install



Which of these files were downloaded on the day I installed homebrew?


Homebrew will check if either Xcode or the CommandLine tools for Xcode are installed during its installation process. If neither, it will install the CommandLine Tools (it informs you of this) as it cannot build installed packages without it. If you remove CommandLine Tools, and/or Xcode, then you break your ability to install or upgrade packages with homebrew.


Finally, How do I undo or delete what I installed that day I accidentally downloaded Xcode?



Xcode does not come with an uninstaller, so you can remove it by dragging the following to the Trash and emptying the Trash:

  • /Applications/Xcode.app
  • /Users/yourname/Library/Application\ Support/Developer
  • /Users/yourname/Library/Developer


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to delete the entire Xcode command line tools from my mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.