How to Conveniently Install and Manage Common Development Tools on a Mac

Published: 2016-10-30

Problem background

When developing on a Mac, you inevitably need to install tools or other programs, such as Git, Node, Maven, etc. On Windows, these tools often require downloading and installing each one individually, but on macOS there is a convenient tool —HomeBrew, which can help us install and manage many common tools. If you are a Mac newcomer who has never used HomeBrew, this post is especially for you, because HomeBrew will quickly become an essential tool for Mac development...

Solution

First, a brief introduction to HomeBrew. HomeBrew is a package manager used to install Unix tools that aren’t included with OS X. Below we explain in detail how to install and use HomeBrew:

Because HomeBrew depends on Ruby, we need to have Ruby installed first. One way to get Ruby on a Mac is to install Xcode, since Xcode installs the development packages required for the Unix environment, which include Ruby (the macOS desktop operating system is Unix-based). The method to install Xcode is straightforward — just get it from the App Store.

  1. First check whether Xcode is installed by running the command xcode-select -p

  2. Check whether Ruby’s version is correct by running ruby -v

  3. After it finishes executing, you can type brew in the terminal to see HomeBrew’s basic usage

After HomeBrew is installed, using the brew install command lets you install many packages at once, for example brew install git node maven mongodb; you can specify one or multiple packages as needed. HomeBrew installs these tools under /usr/local/Cellar and creates symbolic links in /usr/local/bin. Use brew list to see which packages were installed with HomeBrew. For more detailed instructions, refer to theofficial documentation.

Last updated