切换xcode版本

同时安装了xcode8和xcode9,工程中新加了xcode9中特有的内容,直接用xcode打开工程编译没问题,但是使用ci脚本编译时调用到的工具链是xcode8的,导致编译失败
要将工具链设置为xcode9的,需要用到xcode-select命令
打开中断,输入xcode-select命令

~ xcode-select
xcode-select: error: no command option given
Usage: xcode-select [options]

Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example, 
xcodebuild) as well as the BSD development commands (such as cc and make).

Options:
  -h, --help                  print this help message and exit
  -p, --print-path            print the path of the active developer directory
  -s , --switch   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

可以使用xcode-select -p查看当前使用的工具链路径
使用xcode-select -s 来改变路径
要修改为xcode9的工具链,则只需要将使用xcode-select -p显示的路径中xcode的路径改为xcode9的app所在路径即可
之后执行脚本时调用的工具链就是xcode9的

你可能感兴趣的:(切换xcode版本)