2016-06-16 42 views
9

是否可以更改用於構建框架的Carthage Swift版本?更改Carthage Swift版本

我想將我的項目遷移到Swift 3(在Xcode 8測試版上),並且第三方庫是阻止我的項目編譯的唯一東西。 在使用swift 3的特定分支時,Carthage會拋出有關新Swift語法的錯誤。

任何幫助將不勝感激!

回答

19

迦太基使用命令行工具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 

它需要指向開發者SDK目錄中選擇的值決定的,所以你可以使用--print-path以檢查它目前指向。

xcode-select --print-path 
/Applications/Xcode.app/Contents/Developer 

然後去改變它只是運行sudo xcode-select --switch <path-to-beta-xcode>/Contents/Developer

+1

您還可以更改此使用的Xcode>首選項>位置,然後在「命令行工具」 –