Professional Documents
Culture Documents
How To Install Xcode Command Line Tools On A Mac
How To Install Xcode Command Line Tools On A Mac
Developers need to install Xcode Command Line Tools before they can
develop software on a Mac.
It's not pre-installed, but you can install it from the Apple developer website
or the App Store on your Mac.
Instead, you'll install Xcode Command Line Tools. It's a smaller package for
software developers with tools that run on the command line, that is, in the
Terminal application.
Luckily, the Xcode Command Line Tools package only requires 1.2GB of
space on your disk.
You have three choices to install Xcode Command Line Tools on a Mac:
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 1 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
Here are examples of commands that will trigger a prompt to install Xcode
Command Line Tools:
You can also enter the command xcode-select --install in the terminal to
begin the installation process. You'll see a panel that asks you to install
Xcode Command Line Tools.
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 2 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 3 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
$ xcode-select -p
/Library/Developer/CommandLineTools
This option was only recently added to Homebrew, so many developers are
not aware of it.
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 4 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
Since you'll probably need Homebrew, you might as well let Homebrew
install Xcode Command Line Tools for you.
$ brew
Homebrew provides an installation script you can run with a single command
(check that it hasn't changed at the Homebrew site).
The Homebrew installation script will ask you to enter your Mac user
password. This is the password you use to sign in to your Mac.
Password:
You won't see the characters as you type. Press enter when you are done.
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 5 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
If you haven't already installed Xcode Command Line Tools, you'll see a
message that "The Xcode Command Line Tools will be installed." Press
return to continue when prompted by the Homebrew installation script.
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 6 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
On Apple Silicon machines, there's one more step. Homebrew files are
installed into the /opt/homebrew folder. But the folder is not part of the
default $PATH. Follow Homebrew's advice and create a ~/.zprofile file that
contains a command which sets up Homebrew. Homebrew shows
instructions at the end of the installation process:
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 7 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
$ brew doctor
Now you have both Xcode Command Line Tools and Homebrew installed. If
you want to learn more about adding Homebrew packages to set up your
development environment, see Install a Homebrew Package.
More information
I've written an in-depth guide to Install Xcode Command Line Tools that
goes beyond these basics.
In the guide, I explain how to check if Xcode Command Line Tools Are
Already Installed. I go into more detail about how to Install Xcode Command
Line Tools with Homebrew. Finally, I explain how to Uninstall Xcode
Command Line Tools, Reinstall Xcode Command Line Tools, and provide a
List of Xcode Command Line Tools that you can use.
There's also a complete guide to Install Homebrew for Mac that explains how
to Update Homebrew, Uninstall Homebrew, and keep up with other
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 8 of 9
How to Install Xcode Command Line Tools on a Mac 2022-10-19, 1:00 AM
With Xcode Command Line Tools installed, you'll have a solid foundation for
adding almost any open source development tool.
Add Homebrew and you have a package manager that can install version
managers, programming languages, and almost any other tool you may
need.
Combined with a text editor and terminal application, you'll be prepared for
any tutorial you'll find on freeCodeCamp.
https://www.freecodecamp.org/news/install-xcode-command-line-tools/ Page 9 of 9