【问题标题】:Building Xcode Project in Terminal - Choosing another Xcode在终端中构建 Xcode 项目 - 选择另一个 Xcode
【发布时间】:2014-02-26 11:49:54
【问题描述】:

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

【问题讨论】:

    标签: xcode


    【解决方案1】:

    我认为命令 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/Contents/Developer 而不仅仅是 /...Xcode/ ,在设置之前使用 -p 来查看模式
    • 是的,这似乎是正确的。现在是在 jenkins 中使用“sudo”命令的问题,因为它不允许我。
    【解决方案2】:

    我遇到了同样的问题。我已经更改了 Xcode 首选项中的命令行工具选项。在这里你可以选择你想使用的 Xcode 版本。

    【讨论】:

      猜你喜欢
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 2017-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-15
      相关资源
      最近更新 更多