Yogesh Chauhan's Blog

How to Install Xcode Command Line Tools on MacOS?

in Miscellaneous on January 8, 2022

Install Xcode Command Line Tools with Homebrew

A bit about Homebrew

Homebrew is a popular package manager for macOS. It gives you an easy way to install Xcode Command Line Tools.

The updated homebrew installation gives you an option to install the Xcode Command Line Tools when you install homebrew on MacOS, which is a step forward in helping the developers setting up the right tools for development.

Homebrew gives you an option to install many many open source dev tools.

Steps to install Xcode Command Line Tools using Homebrew

Use this code to initiate homebrew installation


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

You’ll need to type your password after the code above starts executing. After the correct password, you’ll see a list of files and folders installing one by one.

Assuming that you don’t have XCode Command Line Tools installed on your machine, you’ll see this message.

“The XCode Command Line Tools will be installed.”

All you need to do is press the return key to keep the installation continue.

Verify the installation


brew doctor

If everything went well in the installation process, you’ll see this message:


Your system is ready to brew

Using this method, we can install both Xcode Command Line Tools and Homebrew.

Install Xcode Command Line Tools using the Command Line

Sounds weird, doesn’t it?

Start the installation using this command


xcode-select --install

A window prompt will be opened outside of the terminal. Click on Install and it’ll be downloaded and installed in a few minutes.

Verify the installation


xcode-select -p

You’ll see the directory where the Command Line Tools are installed.


/Library/Developer/CommandLineTools


Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
How Routing works in Angular?AngularSolution for the error Commit failed – exit code 1 received in Desktop GithubMiscellaneousOptional arguments, Default parameters and REST parameters in JavaScriptJavaScriptStyling Lists with CSSCSSaddcslashes() and addslashes() String Functions in PHPPHPHow to add Laravel to WordPress using Sage theme (and install Tailwind CSS)?PHP