38

I don't know how to install the Command Line Tools on OSX Mavericks. Or better: I know how to do it (I just did it on another MacBook), but something goes wrong this time.

What happened:

  • I Install Homebrew on OSX Mavericks
  • Homebrew ask me to intall the CLT and run a GUI for that
  • I make a mistake: I install XCode instead of CLT, but I find that the CLT was not installed with it

Now, when I write

brew doctor

I get this

Warning: No developer tools installed.
You should install the Command Line Tools.
Run `xcode-select --install` to install them.

I write what it says, but I get always

Usage: xcode-select -print-path
or: xcode-select -switch
or: xcode-select -version
Arguments:
-print-path                                             Prints the path of the current Xcode folder
-switch xcode_folder_path                     Sets the path for the current Xcode folder
-version                                                Prints xcode-select version information

I think I should instead see that GUI (screenshots) that I saw at the beginning and that let me install the CLT.

Does anyone know how can I run that GUI again?

2
  • Presumably you have re-booted. What version of Xcode is installed? Commented Nov 26, 2013 at 22:51
  • 1
    Yes I have rebooted many times. The version of Xcode is 5.0.2 (5A3005). Commented Nov 27, 2013 at 12:58

4 Answers 4

58

Try downloading directly from the Apple Developer Tools site: https://developer.apple.com/downloads/index.action.
This requires signing in with a developer account.

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks Zaph! I downloaded the Command Line Tools from Apple Developer Tools site, then I updated the path of CLT via Terminal: sudo xcode-select -switch /Library/Developer/CommandLineTools. Now when I write brew doctor I get Your system is ready to brew.
@giovanni - how did you know what path to use for the --switch statement?
The switching of the path is what I've been missing and got me stuck for a while. +1 for the comment
Did you need to restart your computer?
So, how do we do this without giving Apple our birth date?
|
17

I came across this issue when I removed Xcode from my laptop (Not enough disk space) and wanted to just install the commandline tools. It installed, but did not fix the Xcode-select path. Using the information above, I then ran:

xcode-select -s /Library/Developer/CommandLineTools

Homebrew is now working great with just the command line tools and I have 9 GB back! Therefore, if you have removed Xcode from your system and just installed the command line tools, you will have to manually run the above command line.

3 Comments

I have similar problem, but when I run this command it gives me: xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
@kelin Install Command Line Tools for Xcode 13.2 (or whatever the latest version is) from developer.apple.com/download/all then run this command. I had to run it as root sudo xcode-select -s /Library/Developer/CommandLineTools
this does not work in Sonoma at least. The directory is not there in this version of Mac OS
11

If you are not able to install the XCode CLI using terminal command

sudo xcode-select --install

Just download the command line tool from Apple developer website (below link)

https://developer.apple.com/download/more/

And install it manually.

4 Comments

AND the response to the command is something like "installation requested" which is failing to inform you that you need to go looking for the GUI window that popped up to handle the install. In a screen full of clutter you can miss it .. heh heh
@vulcan_ well, you saved my day! Thank you!
@vulcan_ - Wow. They don't make a noise, bounce the icon, or bring it to the front of the window stack or anything. Just open it in the background behind everything else and phrase their message as cryptically as possible (not, "Opened a window - go click on the accept button" or something.)
@vulcan_ your comment is so helpful I think you should post it as an answer
0

The probem you're having might be that you have an old version of xcode-select which doesn't have the --install option. I had the same problem, and running xcode-select --version revealed I had version 2003, which is an old one.

What you probably need to do is to restore the original xcode-select system shim that came with your OSX Mavericks, so it will refer correctly to any new xcode or CLT versions you install, instead of being stuck on the old version forever.

This blog post details the problem a bit more: http://magnemg.tumblr.com/post/113251602430/how-to-completely-uninstall-osx-gcc-installer

Here is the torrent with the original OSX Mavericks system shims (extracted from the original installer), so you don't have to download and reinstall the entire OS again: https://archive.org/details/completely_uninstall_osx-gcc-installer

Hope this helps anyone else who might stumble upon this question.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.