Published on

MacOS Dev Environment Setup

Authors
  • avatar
    Name
    Tien Tran
    Twitter
  • Mobile Developer at Use Inc.

Introduction

This guide covers the basics of setting up a development environment on a new Mac.

Xcode

For installing Xcode command line tools run:

sudo xcode-select --install

Homebrew

Homebrew calls itself The missing package manager for macOS and is an essential tool for any developer.

  • Installation
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

iTerm2

iTerm2 is an open source replacement for Apple’s Terminal. It’s highly customizable and comes with a lot of useful features.

Use Homebrew to download and install:

brew install --cask iterm2

Customization Colors and Font Settings Here are some suggested settings you can change or set, they are all optional.

  • Set hot-key to open and close the terminal to command + option + i
  • Go to profiles -> Default -> Terminal -> Check silence bell to disable the terminal session from making any sound
  • Download one of iTerm2 color schemes and then set these to your default profile colors
  • Change the cursor text and cursor color to yellow make it more visible
  • Change the font to 14pt Source Code Pro Lite. Source Code Pro can be downloaded using Homebrew brew tap homebrew/cask-fonts && brew install —cask font-source-code-pro
  • If you’re using BASH instead of ZSH you can add export CLICOLOR=1 line to your ~/.bash_profile file for nice coloring of listings

Oh My Zsh

Oh My Zsh is an open source, community-driven framework for managing your zsh configuration. It comes with a bunch of features out of the box and improves your terminal experience.

Installation Oh My Zsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

The installation script should set zsh to your default shell, but if it doesn’t you can do it manually:

chsh -s $(which zsh)

Bash Completion

Bash completion is a bash function that allows you to auto complete commands or arguments by typing partially commands or arguments, then pressing the [Tab] key. This will help you when writing the bash command in terminal.

brew install bash-completion

Bash completion will be installed in /usr/local/etc/bash_completion.d.

For it to work, add this to your ~/.bash_profile:

[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

Git

For installing Git command line tools run:

brew install git

Visual Studio Code

brew install --cask visual-studio-code

JavaScript

  • ESLint - Useful to check JavaScript errors and helps in auto-formatting the code
  • Prettier - JavaScript code formatter
  • Live Server - Launches a local development server with live reloading for both static and dynamic

Java

Using Java requires you to install a JDK (“Java Development Kit”) or JRE (“Java Runtime Environment”). We’ll use a JDK since it can do everything a JRE can, plus more.

First you should check if Java is already installed

java -version

Installing OpenJDK using Homebrew

brew install openjdk