Mac users who prefer to have a more traditional UNIX toolkit accessible via Terminal may wish to install command line tools on Mac OS X subsection of the Xcode IDE. From MacOS High Sierra, Sierra, OS X El Capitan, Yosemite, Mavericks onwards, this is now easily possible directly and without first installing the entire Xcode package, a developer account is not required either.
The Command Line Tool package provides Mac terminal users with many commonly used tools, utilities, and compilers, including make, GCC, clang, perl, svn, git, size, strip, strings, libtool, cpp, what, and many other commands. Useful that is usually found in the default Linux installations. We’ve included the full list of new binaries available via the command line toolkit below for those interested, or you can see it yourself after you’ve installed the package, which we’ll look at here.
This guide is intended for Mac OS 10.13 High Sierra, 10.12 Sierra, OS X 10.11 El Capitan, OS X 10.10 Yosemite and Mac OS X 10.9, and newer versions. Mac users running earlier versions of OS X can continue to directly install Command Line Tools and gcc (without Xcode) via a package installer available from the Apple Developer website as described here.
INSTALLING COMMAND LINE TOOLS ON MAC OS X
Enter the following command string:
- A pop-up software update window will appear asking: “The Xcode-select command requires the command line development tools. Would you like to install the tools now?
- Wait for the INSTALL COMMAND LINE TOOLS ON MAC OS X package to complete, it will be about 130MB and install fairly quickly depending on your connection speed.
The installer disappears on its own when it completes, and then you can confirm that everything is working by trying to use one of the commands that was just installed, such as gcc, git, svn, rebase, make, ld, otool, nm, whatever you want from the list below. Assuming the installation was not interrupted, the command will run as expected. This also means that you can compile and install things from source directly without having to use a package manager. Enjoy your new UNIX command line toolkit.
What is INSTALL COMMAND LINE TOOLS ON MAC OS X and where
For those interested in knowing the details of what is installed on their Mac and where it is going, the full command line toolkit package is placed in the following directory:
You can browse through that directory if you want, or you can just be aware of it in case you want to modify or tweak any of the packages at a later time.
Note that the directory is the Mac OS root / Library, not a user ~ / Library directory.
If you want to see the 61 new commands available to you, they are all in / Library / Developer / CommandLineTools / usr / bin / but we have also listed them alphabetically below for your convenience:
TROUBLESHOOTING THE “CURRENTLY UNAVAILABLE” ERROR
Are you getting an error message that says “The software cannot be installed because it is not currently available on the Software Update server”? Well, you’re in luck, because that error message probably indicates that you already have Xcode installed on your Mac. From Mac OS X 10.9 onwards, if Xcode is already installed on Mac OS X, then the command line tools will also be installed (you can verify this by trying to run gcc or make from the terminal). Consequently, this tutorial is intended for users who do not want to install the more comprehensive Xcode development package and who prefer only to have command line utilities installed. Yes, that means you can uninstall the entire Xcode app and only install command line tools on MAC OS X if you want, as for many users and sysadmins that’s the only reason they installed Xcode to begin with.