Install command line developer tools in OS X

If you need access to programming tools on your Mac, there are several ways to go about installing them.

Part of OS X is its powerful command-line interface, where a competent or even novice programmer can make use of a number of tools for configuring and customizing the system, and make programs and scripts.

While OS X ships with a number of common commands, by default Apple does not include those that are used for checking out, compiling, and otherwise managing code for developing applications.

If you need these tools for some reason, then there are three ways you can get them on your Mac. The first is to install Apple's XCode developer suite, which is available via the Mac App Store for free. However, installing this will also include XCode itself, and despite its benefits, some people may not wish to have the entire Xcode suite installed on a system.

Command Line Tool downloads for OS X
The command line tools are available as standalone installer packages from the Apple Developer Web site. Screenshot by Topher Kessler/CNET

The next option is to download the latest command line tools from Apple's developer page. To do this, you simply need to log into the downloads section of the Apple developer site using an Apple ID. Here you can search for "Command Line Tools" to view all versions of the tools from Lion through Mavericks. These can then be downloaded as .dmg disk images and mounted, and you can then run the enclosed installer.

The last option is perhaps the easiest, which is to use the system's ability to install the command line tools on demand. This is done by an application in the Macintosh HD > System > Library > CoreServices folder called "Install Command Line Developer Tools." However, this program cannot be launched independently. To run, this program must be invoked by a service or application that calls for the use of the developer tools.

Command line developer tools install prompt in OS X
Running a developer command such as 'make' will prompt for you to install the developer tools, if they are missing. Screenshot by Topher Kessler/CNET

In most cases, standard developer commands like "make," "gcc," "cc," "svn," "git" or Apple-specific tools like "xcode-select" or "xcodebuild" or "xcrun" will require these tools, so running these in some form will spur the system to launch the "Install Command Line Developer Tools" program.

Therefore, to install these tools, simply open the Terminal, type "make" or any desired common developer command, and press Enter, and then when prompted you can install the developer tools (an approximate 100MB download from Apple), and be up and running.

When installed, the developer tools will be placed in the Macintosh HD > Library > Developer directory, which you can peruse to see what exactly has been installed. To uninstall these tools, simply remove the "Developer" folder from the Macintosh HD > Library directory.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Love heavy and clunky tablets?

    Said no one ever. CNET brings you the lightest and thinnest tablets on the market.