8

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'
2
  • 2
    Well, xcode-select --install does not install Xcode. And sudo xcode-select -s /Applications/Xcode.app/Contents/Developer doesn't install it either. So I wouldn't expect that to work, eh. To install Xcode, download it, yourself, and put it in the Applications folder, yourself. Commented Jun 23, 2020 at 0:35
  • There is a blue cloud icon with a down arrow on each app page to download and install. Xcode app: apps.apple.com/us/app/xcode/id497799835 Commented Jun 23, 2020 at 6:13

2 Answers 2

4

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

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

Comments

0

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/

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.