xcodemacoshomebrewxcode9beta6

Brew upgrade not working on latest OSX High Sierra beta version


I am getting the following error when upgrading brew packages

Error: Your Xcode (8.3.3) is too outdated.
Please update to Xcode 9.0 (or delete it).
Xcode can be updated from
https://developer.apple.com/download/more/

Since I am using the beta osx version

High Sierra
System Version: macOS 10.13
Kernel Version: Darwin 17.0.0

It seems like I have to upgrade the beta Xcode version (Xcode 9) too, which I have downloaded and installed successfully from apple website https://developer.apple.com/xcode/

Now, my question is how do I switch the Xcode version on my mac so that brew command uses the newly installed Xcode.

When I run xcodebuild -version I am getting the following output (installed from App store)

Xcode 8.3.3
Build version 8E3004b

whereas the beta version I have downloaded is from the apple website directly shows 9.0 beta 6

enter image description here


Solution

  • Since Xcode is downloaded from the website the full command to switch is the following (considering you've moved the app to the application folder)

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