改变Carthage Swift版本

Nad*_*v96 22 ios swift carthage swift3 xcode8

是否有可能改变用于构建框架的Carthage Swift版本?

我正在尝试将我的项目迁移到swift 3(在Xcode 8 beta上),而第三方库是唯一阻止我的项目编译的东西.在为swift 3使用特定分支时,Carthage会抛出有关新Swift语法的错误.

任何帮助将不胜感激!

bob*_*vil 42

Carthage使用命令行工具xcodebuild来构建框架.命令行系统使用的Xcode版本由工具选择的值确定xcode-select

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 <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
Run Code Online (Sandbox Code Playgroud)

它需要指向Developer SDK目录,因此您可以使用--print-path它来检查它当前指向的位置.

xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)

然后改变它只是运行 sudo xcode-select --switch <path-to-beta-xcode>/Contents/Developer

  • 您也可以使用Xcode> Preferences> Locations,然后使用"命令行工具"更改此设置 (7认同)
  • 最新的Xcode版本支持多个Swift工具链。使用相同的Xcode版本时如何选择Swift版本? (4认同)
  • 这没有回答如何选择Swift版本的问题 (2认同)