Xcode

From wikinotes

xcode is MacOS's IDE and compiler.

Documentation

download old versions https://developer.apple.com/download/more/

Install

GUI

There are two ways of installing xcode.

If you need multiple versions of xcode installed simultaneously, extract them to a temporary folder, rename Xcode.app to include version (Xcode7.3.1.app), then drag it into your Applications/ directory.

CLI Tools

# if xcode-cli-tools are already installed:
# sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install  # Xcode CLI (after Appstore install of xcode)

Usage

targeting a specific Xcode version

env DEVELOPER_DIR="/Applications/Xcode9.4.1.app" /usr/bin/xcodebuild

References

https://support.macincloud.com/support/solutions/articles/8000042681-how-to-utilize-a-different-xcode-version-for-build-process-on-mac
https://medium.com/@hacknicity/working-with-multiple-versions-of-xcode-e331c01aa6bc