Mac下多個Xcode版本切換

有時候會遇到須要一些舊的版本Xcode的狀況,這樣電腦上就要安裝多個Xcode。 各個版本的Xocde下載地址c++

首先須要安裝Command Line Tools

Command Line Tools , 下載與當前系統和安裝的Xcode對應的Command Line Tools(其餘版本的Xcode也在這裏下載)shell

一、顯示當前使用的Xcode

xcode-select -p
//輸出:Applications/Xcode.app/Contents/Developer
複製代碼

二、切換Xcode版本

在shell中, 輸入(後面的路徑爲已安裝的且要切換到得Xcode路徑):xcode

sudo xcode-select -s /Applications/Xcode10.2/Xcode.app/Contents/Developer

複製代碼

查看當前版本bash

gcc --version
//輸出:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
複製代碼
相關文章
相關標籤/搜索