How to uninstall Xcode command line tools

How to uninstall Xcode command line tools

If you no longer need to use Xcode command line tools or you want to completely uninstall Xcode from your Mac, here's a step-by-step guide on how to do it.

What is Xcode Command Line Tools? Why Uninstall It?

What is Xcode Command Line Tools?

Xcode Command Line Tools is an add-on for Xcode that allows developers to use command line tools such as git, svn, make, gcc, clang, and more. It is an essential component for app development on macOS.

Why Uninstall Xcode Command Line Tools?

There are several reasons why you may want to uninstall Xcode Command Line Tools, such as freeing up storage space, migrating to a different version, or troubleshooting issues with the tools.

How to Uninstall Xcode Command Line Tools?

Using Terminal to Uninstall Xcode Command Line Tools

The easiest way to uninstall Xcode Command Line Tools is by using Terminal. Follow these steps:

  1. Open Terminal

  2. Type the following command:
    xcode-select --remove

  3. Press Enter

  4. That's it! Xcode Command Line Tools has been uninstalled.

Using Finder to Uninstall Xcode Command Line Tools

If you prefer using the Finder, follow these steps:

  1. Open Finder

  2. Click on Go from the menu bar

  3. Click on Go to Folder

  4. Type the following path:
    /Library/Developer/CommandLineTools

  5. Delete the entire folder

  6. That's it! Xcode Command Line Tools has been uninstalled.

How to Completely Uninstall Xcode?

Using Terminal to Completely Uninstall Xcode

To completely uninstall Xcode and its components using Terminal, follow these steps:

  1. Open Terminal

  2. Type the following command:
    sudo rm -rf /Applications/Xcode.app

  3. Press Enter

  4. Type your Mac password when prompted

  5. Type the following command:
    sudo rm -rf ~/Library/Developer/Xcode

  6. Press Enter

  7. Type the following command:
    sudo rm -rf /Library/Developer/Shared/Xcode

  8. Press Enter

  9. That's it! Xcode has been completely uninstalled.

Using Finder to Completely Uninstall Xcode

To completely uninstall Xcode using Finder, follow these steps:

  1. Open Finder

  2. Click on Applications from the sidebar

  3. Drag Xcode to the Trash

  4. Right-click on the Trash and select Empty Trash

  5. Type the following path in Finder:
    ~/Library/Developer/

  6. Delete the Xcode folder

  7. Type the following path in Finder:
    /Library/Developer/

  8. Delete the Xcode folder

  9. That's it! Xcode has been completely uninstalled.

If you need to uninstall Xcode Command Line Tools or Xcode from your Mac, follow the steps above carefully to avoid any issues. Remember to double-check your commands before entering them in Terminal to avoid any accidental deletions.

Related articles

Ruslan Osipov
Written by author: Ruslan Osipov