Installing XCode Error: invalid developer directory

Using Terminal, trying to load Xcode.

xcode-select: error: invalid developer directory ‘/Library/Developer/CommandLineTools’
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools

…? I have zero clue what to do next. Install it from an online download?

Thanks in advance!

1 Like

What version of macOS are you running? What was the exact command you typed in the Terminal that produced this error? Are you trying to install via Brew?

Try to install Xcode from either the App Store, or directly from Apples website. Once complete, in the Terminal run “xcode-select --install”

It turns out that my MacBook Pro is too old. I’ll need to upgrade the whole thing in order to use the latest XCode. I’ll be back once I pay for a new one…!

I have a MacBook Pro (13-inch, Late 2011), running Sierra macOS 10.12.6. Xcode 11 requires macOS 10.14.4. The 2011 laptop cannot be upgraded, it needs to be replaced.

1 Like

Ah, yeah, unfortunately that’s true. Sorry to hear about that!

I haven’t tried this but it may solve your problem?

‘How to Install macOS 10.15 Catalina on an Unsupported Mac’:

Update - I got a refurbished Macbook Pro, so I’m starting fresh!

1 Like