mokacoding

unit and acceptance testing, automation, productivity

Setting a Mac for Development

Last week I setup our new office Mac Mini, that we will use as CI server for our iOS apps (finally!), and for other tasks, such as a constant view on our products analytics.

Our machine is the workshop where we create awesomeness (or bugs). I really love setting up a machine for development, but I've always ended up mad at something, or spending ages looking how to install this or that. So this time, once and for all, I took note of every step, and here's my little checklist on how to set up a Mac for development.

Note: the original version of this post was long and basically just me blabbering about the usual suspects, Ruby, Node, Xcode… I refactored it in a condesed version. No need to thank me.

Setup OS X for Development: the checklist

Homebrew

Save time, and your sanity, use homebrew!

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

homebrew saves stuff in /usr/local/bin, so make sure it comes before the default /bin in the $PATH.

export PATH=/usr/local/bin/:$PATH

zsh

brew install zsh

Zsh is cool, and with prezto we can make it super shiny.
Note: the following instructions are from the prezto README, check it out just to be sure they are up to date.

zsh
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
  ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done

Finally, set zsh as the default shell

chsh -s /usr/local/bin/zsh

Ruby, of course via rvm

\curl -L https://get.rvm.io | bash -s stable
rvm install 2.0.0

Python, a proper one

brew install python

Node.js

Just head to the home page and hit the green "Install" button, it's the reccomened way! Or use homebrew again:

brew install node

Xcode and the Command Line Tools

Get it from Apple's Developer page, and then search for "Command Line Tools" in the "Downloads" tab of the "Preferences".

There's also an open source way, but I haven't tried it.

Java

Apparently OS X doesn't come with Java ready for us, but at least installing it is easy, just try to use it in the terminal, and the installation wizard will start.

java

Some useful extra stuff

Vote on Hacker News