xcrun can't find Xcode path

Fixed! In terminal:

$ DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"  
$ export DEVELOPER_DIR  

Explanation:
While reading man xcrun I noticed that there is DEVELOPER_DIR environment variable that takes precedence of xcode-select. So here we are setting that variable to correct path.


Run this to set your Developer folder:

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

Open Xcode > Preferences > Locations > Select your Xcode version from the dropdown and exit Xcode ref