Setting up Mac for Development/Coding

You may need to setup up your brand new Mac or after purchasing a used one with factory reset for software development purposes. While I understand that the usage behavior of individuals differs, there are some settings and software that most of the developers use or should use.

In this article, I am going to cover setting up your mac for software development. I will keep this article updated with settings/software I come across in the future. Let’s begin.

Setting up Mac for Development

Let’s begin with updating your system to the latest macOS. If you already have the latest one, move to the next section.

Updating Mac

The first thing you need to do is update your system.

To do that go: Apple menu () > About This Mac > Software Update.

Also, upgrade your OS to the latest version to have a more secure OS.

Installing Xcode

Xcode is a sort of mandatory software in Mac for software development. Xcode comes up with compilers and other basic software that we need to use to build programs.

To install Xcode, run the following command in the terminal.

sudo xcode-select --install

Installation of Xcode may take some time depending on your internet bandwidth. It’s worth the wait.

Install Homebrew

I have just one word for Homebrew. It’s awesome. It’s the best software for the developer community. Homebrew is the package manager and allows you to install/update software with few lines of command.

Once Xcode is installed, run the following command in the Terminal to install Homebrew.

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

To verify Homebrew installation, run this:

brew doctor

Installing core softwares

Listing some of the core software that I believe every developer needs to have.

Just copy/paste the shell command shown below in the terminal to install.

brew install \
  git \
  make \
  tree \

Installing necessary softwares

Now, this may change according to your needs. Add/remove the packages based on your need.

brew cask install \
  alfred \
  appcleaner \
  visual-studio-code \
  google-chrome \
  flux \
  firefox \
  iterm2 \
  docker \
  vlc \
  slack \
  spotify \
  postman

Installing ZSH

If you are not using MocOS Catalina, you need to install ZSH separately.

brew install zsh

Install Oh My ZSH.

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

Then run,

chsh -s $(which zsh)

Check out the configuration page to customize ZSH according to your need and taste.

Configuring Git

First thing first, set up your Git username ( make sure it’s the same as the Github ).

git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"

Next, create a global level .gitignore file. You can add/remove the file name as per your requirement.

create a new file in the home directory.

nano ~/.gitignore

Copy/paste the following content.

# Folder view configuration files
.DS_Store
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes

# Compiled Python files
*.pyc

# Compiled C++ files
*.out

# Application-specific files
config.json
config.js
.env
node_modules
.sass-cache

Install Programming languages/framework software

Let’s install the required software for programming purposes. I generally use Node, Python, Rust, and C++. C++ already gets installed with Xcode. Let’s install the rest of them.

Installing Node using NVM:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

Then,

nvm install node

Restart the terminal and run this command.

nvm use node

Verify the Node installation.

node -v
npm -v

Installing Python:
Run this command to install Python3.

brew install python

For Python 2.7.

brew install python@2

Install Pip.

curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
sudo python get-pip.py

Installing Rust:

Run this command to install Rust.

brew install rustup
rustup-init

Verify Rust installation.

rustc --version

Installing Database softwares

I generally work with MongoDB, MySQL, and Redis. Let’s install them.

Installing MongoDB:

brew tap mongodb/brew
brew install mongodb-community

Installing MySQL:

brew install mysql

Run MYSQL as a service.

mysql.server start | stop

Installing Redis:

brew install redis

Verify the installation.

redis-server

Configuring Visual Studio Code

I use the following VSCode extensions:

  • ESLint
  • GitLens
  • Prettier
  • Path intellisense
  • Rust

You can search these extensions in the VSCode and install them one by one.

And Cobalt2 theme from Wesbos.

It looks pretty good.

Related: Top 15 Must Have Visual Studio Code extensions

System preferences

Here are a few things I change in the system preferences.

First, change the screenshots folder ( by default Mac save it on Desktop )

defaults write com.apple.screencapture location <full path to the folder>

Add your iCloud account and sync Calendar, Find my Mac, Contacts, etc.

I change trackpad settings and enable the tap to click with one finger feature. I generally use Logitech MX master 2 as a wireless mouse.

I change the dock setting and make the icon size smaller. I remove lots of default applications from the dock as well. Keeping it minimal and simple.

Mac dock

Thoughts?

If you have any suggestions, feedbacks or any software I am missing out big time. Do let me know.

Pankaj Kumar
Pankaj Kumar
Articles: 206