we all know,There is pyenv when using Python,If you use ruby, there is rbenv,Can easily control and manage the version of the programming language environment,Then,Is there any way,Can Xcode switch versions like this?
Every time Xcode releases an update,More or not has become a problem,Difficult to download,Can't resume,Can't use third-party tools to download,It's really terrible... not to mention the compatibility issue when multiple versions。
use xcode-install,Solve these problems at once,Yay!
It is a tool specifically for managing Xcode versions,You can switch between different versions of Xcode with one click,Install multiple versions of Xcode on your Mac,Very convenient。
First of all,Use the command to install it: gem install xcode-install ,
Then update the list of available versions: xcversion update ,However, because it is to pull the list of all available versions from the Apple developer website,So you need your developer login account and password,These will be saved in the local iCloud keychain,do not worry。
After entering, you are likely to encounter the following error:
1 |
.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems/version.rb:215:in `initialize': Malformed version number string Xcode (ArgumentError) |
This is due to you currently have Xcode installed,This prevents xcode-install from creating links,so,Based on your currently installed Xcode version,Rename the currently installed version,For example, the version I have installed is the latest 11.5,Then put Xcode.app Renamed Xcode-11.5.app ,Then try again。
After updating the list, you can install according to the version number in the list,you can see,In the version list,11.5 Version is already installed:
1 2 3 4 5 |
11.4.1 11.5 beta 11.5 (installed) 11.5 GM Seed 11.5 beta 2 |
Just use the command xcversion select 11.5 Make the current Xcode effective。
use xcversion selected To verify:
1 2 |
Xcode 11.5 Build version 11E608c |
Now xcode-install can correctly identify the version of Xcode that we originally installed and are using。
Note that if the version number contains spaces,Such as beta,Then you need to enclose the version number in single quotes,Use command to install another version of Xcode:
1 2 3 4 5 |
xcversion install '12 beta' ... Successfully verified Xcode installation at path '/Applications/Xcode-12.beta.app' 🎧 Xcode 12.0 Build version 12A6159 |
Frequently broken during downloading,it's OK,You can rerun the installation command,It is cached,So it can resume uploading,For friends with poor network quality,Really comforting。
Original article written by LogStudio:R0uter's Blog » Use xcode-install to manage Xcode versions
Reproduced Please keep the source and description link:https://www.logcg.com/archives/3377.html