Issue: You may wish to override the default Xcode Active Developer Directory. However, managed server users may not change the default Xcode active developer directory using the "sudo xcode-select --switch /Applications/Xcode7.3.1.app" command.


Solution: To override the default Xcode Active Developer Directory, simply set the environment variable "DEVELOPER_DIR" in the Terminal app to the desirable Xcode version.


Example: 

  

env DEVELOPER_DIR="/Applications/Xcode7.3.1.app" /usr/bin/xcodebuild

  

This will execute xcodebuild using an alternate developer directory (Xcode 7.3.1), rather than the xcodebuild tool that comes with the default Xcode.