I'm available for challenging remote roles. Let's get in touch.

How to install Command Line Developer Tools on macOS

Learn how to install the Command Line Developer Tools in four easy steps.

Flavio Silva
Flavio SilvaJune 12, 2023
How to install Command Line Developer Tools on macOS
Image by Freepik

I last tested these instructions on macOS Ventura 13.3.1.

Introduction

In this step-by-step guide, you'll learn how to install the Command Line Developer Tools in four easy steps.

What are the Command Line Developer Tools?

Note: If you know you will install Xcode, you don't have to follow this guide to install the Command Line Developer Tools as it's installed when you install Xcode. Otherwise, you can follow this guide to install it, as Xcode is much heavier to download and install (7+GB), and the tools are lightweight.

Installing the Command Line Developer Tools is the first thing you must do when setting up your Mac for software development.

It enhances the development capabilities of macOS by providing a robust set of development tools, including compilers, debugging tools, and other essential components necessary for building and maintaining software applications.

So let's get it installed.

Do not type the $ sign you see in the command examples in this article. That's just an indicator that you should run the command that follows it in your command line tool.

Step 1. Make sure your macOS is up to date

Before proceeding, make sure your macOS is up to date. Otherwise, you might get an error installing the Command Line Developer Tools.

Step 2. Check if you already have the Command Line Developer Tools installed

Launch the Terminal and run the following command:


$ gcc --version

If you already have the Command Line Developer Tools installed, you should see an output including the following:


Apple clang version 14.0.3 (clang-1403.0.22.14.1)

If you don't have it installed, you should see a standard message on the Terminal starting with the following:


xcode-select: note: No developer tools were found, requesting install.

And a popup window should show up with the following message:


The "gcc" command requires the command line developer tools. Would you like to install the tools now?

Step 3. Install the Command Line Developer Tools

Go ahead and hit the Install button. It should take only a few minutes.

If everything succeeds, you should see a message like The software was installed.

Step 4. Check the installation

Run $ gcc --version again to check if everything worked as expected. You should see an output including the following:


Apple clang version 14.0.3 (clang-1403.0.22.14.1)

You're done. Congrats! You now have the Command Line Developer Tools installed.

If you plan to implement native macOS, iOS, watchOS, or TvOS apps, you can install Xcode from Apple's App Store.

Conclusion

And that's it for this guide. I hope you enjoyed it!

Thank you for reading, and let me know if you have any issues or suggestions in the comments below.

How to set up your Mac for software development
How to install and use Homebrew on macOS
How to install Git with Homebrew on macOS
How to install and use Antigen and Oh My Zsh on macOS
How to install and run Node.js with nvm on macOS
How to generate and use SSH keys on macOS
How to sign Git commits with SSH keys on macOS

How to install Command Line Developer Tools on macOS by Flavio Silva is licensed under a Creative Commons Attribution 4.0 International License.

Leave a comment using your GitHub account

© 2024 Flavio Silva