Install Homebrew on MacOS for More Dev Tool Options

Although macOS is one of the more user-friendly operating systems on the market, as a developer, you might find it to lack some of the tools you depend on.
For instance, you might need VS Code, Android Studio, Docker, Node.js, Gi, MySQL, PostgreSQL, NGINX or any number of other development tools. Although it’s possible to install such software using the default methods, you might want to know that there’s a better way, thanks to a tool called Homebrew.
Homebrew is a command-line package manager for macOS that is similar to a lot of the Linux package managers (such as apt, dnf and pacman).
It’s important to know, however, that Homebrew is all about command-line applications. If you want graphical user interface (GUI) apps, then you have to install a secondary piece of software, called Cask. Both of those apps work well together to create the macOS package manager that you’ve been missing this whole time.
One of the reasons why I employ Homebrew and Cask is that I’m fond of using the command line to install applications (I’ve been using Linux since the late 90s), but also because there are some apps you can only install via Homebrew. Also, Homebrew is open source, which greatly simplifies the installation, updating and managing of software on macOS. Homebrew is simple, versatile and can help improve your productivity with a host of available apps.
But how do you install and use Homebrew and Cask?
Let me show you how it’s done.
What You’ll Need
The only thing you’ll need is a macOS device, either a MacBook or an iMac. It doesn’t matter if the device is Intel or Apple Silicon powered (but do keep in mind that most Intel-based Macs will soon no longer be supported).
Installing Homebrew
To install Homebrew on your Mac, the first thing you must do is open the terminal window. If you’re not familiar with the terminal, there’s no need to fear it. If you’re a developer, you’ll feel right at home running commands.
With the Terminal app open, install Homebrew with the command:
Here’s the thing about this installation: It’s going to take some time. Expect anywhere from 5-30 minutes (depending on the speed of your machine and internet connection). There are several dependencies that must be taken care of, and the compilation can be time-consuming. You can do yourself a favor by closing all other apps before you run the command.
When the installation of Homebrew is completed, you can then install Cask.
Installing Cask
The installation of Cask is not nearly as complicated (or time-consuming). To install Cask, issue the command:
What’s really cool about that is you just installed your first piece of software with Homebrew!
Groovy.
Installing Software With Homebrew and Cask
It’s now time to install some software with Homebrew and Cask. Let’s start off by installing a command-line app with Homebrew. As you saw above, the structure of the installation command looks like this:
Let’s say you want to install the wget app, so you can download files from the command line. To install that software with Homebrew, the command would be:
Once the installation is complete, you can use the app as you normally would, such as:
Where domain.com is the domain name and file is the file name you want to download.
You can view an entire list of the available software for Homebrew on the Homebrew Formulae page (caution, there are a lot of apps).
Installing Software With Cask
Installing apps with Cask is similar to that of Homebrew, with one small difference. The structure of the command is:
Where APP is the name of the app you want to install. Yes, you’re using Homebrew to run the installation, but you inform it that you’re installing a GUI app by way of Cask. For a complete list of available Cask software, check out this Homebrew Formulae page (again, there are a lot of apps you can install).
For example, you could install the android-ndk app (a set of tools to implement parts of Android apps in native code) with the command:
Unlike installing the command-line tools with Homebrew, after you install a GUI app with Cask, you’ll find it listed in Launchpad or the Finder Applications folder. With Homebrew apps, they’re all invoked from the command line.
And that’s all there is to installing Homebrew and Cask on macOS. If you’re a developer, I believe you’ll find both of these tools an absolute must if you want to get the most out of macOS for your projects.