Skip to content

OS X

This document describes how to set up an OS X machine for development.

Apple Silicon

Apple has begun transitioning its lineup from Intel-based Macs to Apple Silicon based Macs.

If you’re using a Mac with an M-series chip, such as M1, M2, M2 Pro, et cetera, you will need to install Rosetta 2 in order to make use of some of the tools listed below, as some were originally built for a different architecture ( x86-64/amd64 vs. arm64).

To install Rosetta 2, run the following command in Terminal:

Terminal window
softwareupdate --install-rosetta

Most programs will run fine now, though you might need to configure some programs to specifically use Rosetta 2. An example of this is Docker Desktop:

Docker Desktop Rosetta 2 - Step 1

Docker Desktop Rosetta 2 - Step 1

Nearly all Docker images will run fine now, even if they were originally built for x86-64/amd64.

You might run into some issues with images that run Python, though.

To run those images, you need to specify the architecture platform:

Terminal window
docker run --platform linux/amd64 <image>

This works fine for running an image incidentally, but if you want to use Docker Compose, you need to specify the platform in the Dockerfile that built the image:

Terminal window
FROM --platform=linux/amd64 <image>

This changes nothing about the image itself, other than explicitly telling Docker that the image is built for x86-64/amd64. It already saw that before, but somehow it refused to run it through Rosetta 2.

If you cannot change it yourself, consider asking the maintainer of the image to do so.

Installing Xcode

Install Xcode through the App Store application. After the installation is completed, accept the license.

Terminal window
sudo xcodebuild -license

Also install the Xcode command line tools. Some packages may depend on this. Run the following command and follow instructions from the dialog which pops up:

Terminal window
xcode-select --install

Installing Brew

Read Brew and install it.

Installing Tools with Brew

You can now install the required command line programs and libraries using brew install.

Terminal window
brew install bash
brew install gettext
brew link gettext --force
brew install python3
brew install ant
brew install libimobiledevice
brew install libtiff libjpeg webp little-cms2 # for pillow
brew install libmagic # for python-magic

Next install some graphical tools using cask.

Terminal window
brew install --cask google-chrome
brew install --cask temurin # JDK from the Eclipse Foundation

Use gem to install Bundler. This is used to install Fastlane in an isolated environment, which in its turn is used for iOS development.

Terminal window
sudo gem install bundler

Use brew to install Node.js without npm. Then install npm manually. This will make sure npm won’t be managed by two package managers.

Terminal window
brew install node --without-npm
curl -L https://www.npmjs.com/install.sh | npm_config_prefix=/usr/local sh

Some tools need to be installed outside of brew

Terminal window
pip3 install --upgrade pip setuptools
npm -g install grunt-cli
npm -g install gulp
npm -g install bower
npm -g install ios-deploy
npm -g install ios-sim

Android

The android tools should be installed as follows:

Terminal window
brew install android-sdk
android update sdk --no-ui --all --filter build-tools-23.0.3
android update sdk --no-ui --all --filter platform-tools
android update sdk --no-ui --all --filter tools
android update sdk --no-ui --all --filter android-23

Docker

Installing Docker is as easy-peasy.

Simply go to the Docker for Mac, choose your type of Mac (Intel or Apple Silicon), and download the installer.

Click through the prompts on the installer and Bob’s your uncle. You can now use Docker.

Note that for Apple Silicon Macs you will need to use Rosetta 2 to run Docker Desktop. See the section on Apple Silicon above for more information. Please also note that macOS will reserve port 5000 for control center, so you will not be able to use that port for your Docker containers.

Additional tools

The following tools are convenient, but not necessary.

Terminal window
brew install bash-completion
brew install shellcheck
brew install tmux
brew install tree
pip install virtualenv

Some tools are outdated by default on OSX. It’s better to install them using Homebrew.

Terminal window
brew install git
brew install vim