Xcode says "No Xcode Selected" but "xcode-select -p" and "xcodebuild -version" do show a version

We have xcode 8 and 9 installed and have run xcode-select to set the default version for the command line tools. In the terminal, I can run

xcodebuild -version


OR


xcode-select -p


and each of them show that the correct version (xcode 9) is selected. However when I open xcode and check Preferences -> Locations it shows no value in the drop down to select the default version for the CLT.


Here's a screenshot showing both the terminal window display and the preferences in xcode.

https://imgur.com/a/8sdK1


Any idea why this might be happening?

Post not yet marked as solved Up vote post of McdDevops Down vote post of McdDevops
1.5k views