Switch Xcode version from CLI
# print current selected Xcode path
xcode-select --print-path
# switch to another version of Xcode
sudo xcode-select --switch /PATH/TO/YOUR/OTHER/XCODE/Xcode45.app
# switch back to main Xcode version / installation
sudo xcode-select --switch /Applications/Xcode.app