Switch between XCode versions

Install command line tools

$ xcode-select --install

Enable command line tools

$ sudo xcode-select --switch /Library/Developer/CommandLineTools

Enable full XCode app

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Source: https://github.com/nodejs/node-gyp/issues/569