Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

macos

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'
like image 886
NameIsPython Avatar asked Jun 22 '20 23:06

NameIsPython


1 Answers

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

like image 119
The Crazy Startup Guy Avatar answered Nov 15 '22 07:11

The Crazy Startup Guy