1.首先可以在Xcode中可以通過Xcode > Preferences > Locations路徑查看到正在使用的版本和該版本路徑蒋得,如下圖
2.可以通過xcode-select命令進(jìn)行查看與修改
通過xcode-select -h命令查看可以使用的命令如下:
-h, --help print this help message and exit
-p, --print-path print the path of the active developer directory
-s <path>, --switch <path> set the path for the active developer directory
--install open a dialog for installation of the command line developer tools
-v, --version print the xcode-select version
-r, --reset reset to the default command line tools path
3.各命令詳細(xì)介紹
(1)查看xcode-select可使用命令
xcode-select -h
or
xcode-select --help
(2)查看當(dāng)前正在使用的Xcode版本路徑
xcode-select -p
or
xcode-select --print-path
(3)查看xcode-select版本
xcode-select -v
or
xcode-select --version
(4)重置為默認(rèn)的命令行路徑
xcode-select -r
or
xcode-select -reset
(5)修改Xcode使用版本
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
or
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer