NameIsPython
NameIsPython

Reputation: 91

Trouble installing Xcode: invalid developer directory '/Applications/Xcode.app/Contents/Developer'

I am using macOS Catalina (10.15). I want to install Xcode, but having trouble.

When I type following in the terminal, I get an error.

$ xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

But when I type the following, I get this error:

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'

Upvotes: 8

Views: 3940

Answers (2)

TRicks43
TRicks43

Reputation: 149

If Xcode was downloaded from apple.com Xcode.app/Contents/Developer cannot be there. That's a Developer command line tools install you must have got all Dev binaries under CLI pkg:

sudo xcode-select --switch /Library/Developer/CommandLineTools/

Upvotes: 0

The Crazy Startup Guy
The Crazy Startup Guy

Reputation: 41

I was new to MacOS when I encountered this issue too.

To install Xcode we have two ways: Web and App Store on your Mac. If you download it using App Store the application will be present in the Applications Folder. For Web, a .xip is downloaded at your Download location by default Downloads Folder, which you need to click for the extraction to take place. Once the extraction happens, a Xcode Application will appear in the same location. Double click on the Application for it to install and then place the Application in the Applications Folder for it to appear in the Applications.

Now you will need to set the path for Command Line to be able to use Xcode commands.

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer if you are using the Beta Version

or else

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Note: Check your Xcode Application and use that in the path:

/Applications/Xcode Application Name.app/Contents/Developer

Upvotes: 4

Related Questions