MacBook: Dev Setup

12,165 reads

“MacBook Pro” by Fabian Grohs on Unsplash

I have been using mostly Linux for many years now but, I just got a new Macbook Pro (2018). I had moderate previous experience with macOS before but I never had one of these machines as my main gear. After my initial “wow” moments with its screen and some “wtf” moments with its (lack of) ports, I started migrating my environment and searching for whatever I had to install to make this beast my own. Below is a step by step guide of this procedure which covers almost all my needs as a Java / Javascript Developer, although most parts can be valuable to most people as well.

The missing package manager

Before everything else, we should install Homebrew, the missing package manager for MacOS. Homebrew is mainly used for installing packages and command line utilities but, it can also be used to install normal non-open source applications.This will help a lot with the installation of all the remaining software and packages you will need and also maintaining them ( removing , cleaning dependencies etc ). To do that, open a terminal and run the below command.

≈/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Just follow some on screen instructions and after that is finished, move over to the good stuff.

Terminal on steroids

I use terminal a lot during my daily work so this was the first part I tried to upgrade. After some searching i found iTerm2 which covers all the features I was used to with my previous terminals ( tilix on Linux, cmder on Windows ). You can download it from its official page or, use homebrew that we previously installed :

brew cask install iterm2

After the install there are countless things you can tinker on this app but with some more steps we will get a lot more. Next we should change the default unix shell of MacOS from Bash to Z shell. There are various pros to this move like better auto-completion and command history. Zsh comes installed on MacOS but it is better to install its latest version so, type this on your terminal.

brew install zsh

After that check your version :

zsh — version

at the time of writing this, it should be zsh 5.6.2

Next make zsh the default unix shell :

chsh -s $(which zsh)

Now we can either live with just the zsh or we can install a framework that will bring along many new plugins and themes for our shell. There are various choices here but the one I got in the end is oh my zsh. To install it just type :

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

Now we can enable whichever plugin we want from the various that the framework brings along or new ones found online. To enable the plugins you like, you have to edit your .zshrc file.

vi ~/.zshrc

There you must find the plugins array and add the ones that you want.

some notable mentions here, zsh-syntax-highlighting and zsh-autosuggestions

Lastly, we should install a preferred theme for iTerm2. Easiest solution would be dracula which can be applied on most other apps/editors as well, although i went with Material Colors. Just download the preferred one and apply it through the Preferences page of iTerm2.

Brew up your Dev stack

Now that we have our terminal set up, we can start installing all the required applications. Most of the work below can either be done through Homebrew or by downloading everything from their respective websites. There is one other thing that especially developers will need and that is the need to keep multiple versions of SDK’s installed on your machine. Homebrew by default installs the latest one and, for some packages there might be some older versions, but that is not the normal case. For that firstly we will install another tool, the SDKMAN!. Go on your terminal, type the below command and follow the on-screen instructions.

$ curl -s “https://get.sdkman.io" | bash

A list follows with some pretty basic installs that I, and most of us, will have to do.

Java SDK sdk install java

gradle sdk install gradle

mysql brew install mysql

mongodb brew install mongodb

elasticsearch brew install elasticsearch

Now, before we move over to actual applications, NodeJS is also required. For this we need the nvm tool to be able to install and change into multiple Node version. Either install the tool itself with :

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

or install the zsh-nvm which will take care of easily upgrading nvm later on. After nvm’s installations just install (latest or specific versions) node by typing :

nvm install node

which will install latest nodeJS and accompany npm.

Now, let’s finish this up with some tools and required editors of choice. I needed the MySQL Workbench, Docker, GitKraken as my git GUI client, PostMan for API Testing, Android Studio for Android Development, Toolbox by Jetbrains which will handle WebStorm for Javascript projects and IntelliJ for Java projects. Furthermore I usually also use SublimeText or Visual Studio Code for simpler things. All the above can be installed with Homebrew so you could just type :

brew cask install \

mysqlworkbench \

docker \

gitkraken \

postman \

android-studio \

jetbrains-toolbox \

sublime-text \

visual-studio-code

After some time everything will be downloaded and installed, ready to use.

Required Generics

Lastly, I made a list of some generic applications that will be needed during daily use, based on personal choice.

brew cask install \

gimp \

skype \

viber \

slack \

google-chrome \

microsoft-office \

spotify \

vlc \

evernote \

the-unarchiver

After all these are done installing, I felt like my new and powerful MacBook is ready to replace my old Dell as my daily driver. Many of these would not apply to anyone but following brew / cask installs it should be a breeze to set up a new machine and have it ready to use in no time.

Tags