How to downgrade xcode completely from the terminal/shell?

Viewed 4447

I'm not too familiar with mac and iOS but I need to downgrade xcode on a mac host for CI stuff (current app build is failing on xcode 12). I have access to the host via jumphost and I'm not sure if I can connect via VNC (I also don't like this since it's terribly slow) and most of the guides need a UI to download xcode. Any ideas on how to do this completely via terminal?

1 Answers

First of all download older version of Xcode, you will be need sign in to open the Downloads page.
Here is the Xcode releases page with downloads and release notes.

And install it.

After installing you can switch to the version you currently desire (for example 11.2 below) via terminal using a command like this:

sudo xcode-select -switch /Applications/Xcodex.11.2.app
Related