Error Xcode Select Error Tool Xcodebuild Requires Xcode Active Developer Directory Command Line Tools Instance

Sun Mar 19, 2017

I have been playing with Cordova lately and was getting this error when building iOS version:

Error: xcode-select: error: tool 'xcodebuild' requires Xcode,
but active developer directory is a command line tools instance

Even full install of Xcode didn’t fix this error.

The solution was to run following command to use full Xcode instead of command line tools version that I had installed earlier:

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer