在终端中构建Xcode项目-选择另一个Xcode

在终端中构建Xcode项目-选择另一个Xcode,xcode,Xcode,我在同一个mac上安装了两个不同的Xcode版本(Xcode 4和Xcode 5)。Xcode 4位于应用程序文件夹中。 因此,每当我从终端构建任何项目时,它都会使用Xcode 4进行编译。有没有办法使用Xcode 5(在桌面上)从终端构建一个项目?我认为命令Xcode select就是出于这个确切的原因 Usage: xcode-select [options] Print or change the path to the active developer directory. This

我在同一个mac上安装了两个不同的Xcode版本(Xcode 4和Xcode 5)。Xcode 4位于应用程序文件夹中。
因此,每当我从终端构建任何项目时,它都会使用Xcode 4进行编译。有没有办法使用Xcode 5(在桌面上)从终端构建一个项目?

我认为命令
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
用法:xcode选择[选项] 打印或更改active developer目录的路径。这个目录 控制用于Xcode命令行工具的工具(例如, xcodebuild)以及BSD开发命令(如cc和make)。 选项: -h、 --帮助打印此帮助消息并退出 -p、 --打印路径打印active developer目录的路径 -s,--开关设置active developer目录的路径 -v、 --版本打印xcode选择版本 -r、 --重置为默认命令行刀具路径
我也有同样的问题。我已经更改了Xcode首选项中的命令行工具选项。在这里,您可以选择要使用的Xcode版本。

请注意,路径是/…XCode/Contents/Developer,而不仅仅是/…XCode/,请在设置查看正确的模式之前使用-p。现在是在詹金斯使用“sudo”命令的问题,因为它不允许我。