1

I am trying to uninstall Xcode command line tools and I used the command:

sudo rm -rf /Library/Developer/CommandLineTools

to delete the folder but when I use the command:

xcode-select -p

it still shows the folder:

/Library/Developer/CommandLineTools

Am I doing something wrong since the folder is still showing up?

Note that when I issue the command

ls -al /Library/Developer/CommandLineTools

the computer tells me there is indeed no such file or directory. I have confirmed that the trash is empty after deleting the folder and restarted my computer.

The computer is an M1 MacBook Air with macOS Monterey 12.2.1. Xcode was installed on it previously but I deleted the files associated with it.

9
  • I have a m1 Macbook air and I have MacOS monterey and it is version 12.2.1. I did have Xcode installed but I believe that I have deleted the files associated with it. Commented Sep 11, 2023 at 20:26
  • 1
    xcode-select -p prints the currently selected path. Doesn't mean there's anything THERE. Commented Sep 11, 2023 at 21:08
  • Since it prints the current path, does that mean those folders are still there? I have tried to find them but I am not able to. Commented Sep 11, 2023 at 22:23
  • It tells me there is no such file or directory. Commented Sep 12, 2023 at 13:57
  • Then you've answered your own question. The system was configured to use a particular path for the tools, you reached out of band to delete that directory, why would the system not still reflect what it had been told? Commented Sep 12, 2023 at 14:37

1 Answer 1

1

It looks like somehow the Xcode related settings has not been kept up-to-date along with the changes you have made on your computer. The following command to be issued through Terminal may help:

sudo xcode-select --reset

Here is the description of the --reset option for xcode-select according to the man pages:

-r, --reset
   Unsets any user-specified developer directory, so that the
   developer directory will be found via the default search
   mechanism. This command must be run with superuser permissions
   (see sudo(8)), and will affect all users on the system.

You must log in to answer this question.

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