2014-02-26 96 views
1

我在同一個mac(Xcode 4和Xcode 5)上安裝了兩個不同的Xcode版本。 Xcode 4位於應用程序文件夾中。 因此,無論何時從終端構建任何項目,自然都會使用Xcode 4進行編譯。有什麼方法可以使用Xcode 5(位於桌面)從終端構建項目?在終端中編譯Xcode項目 - 選擇另一個Xcode

回答

2

我認爲命令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 
    -v, --version    print the xcode-select version 
    -r, --reset     reset to the default command line tools path 
+1

注意路徑/...XCode/Contents/Developer不僅僅是/...Xcode/,使用-p設置你看到的格局 –

+0

是的,這似乎是正確的了。現在是在詹金斯使用「sudo」命令的問題,因爲它不允許我。 – MeM

-1

我有同樣的問題。我改變了Xcode偏好設置中的命令行工具選項。在這裏你可以選擇你想使用的Xcode版本。 enter image description here