在终端中构建 Xcode 项目 - 选择另一个 Xcode [英] Building Xcode Project in Terminal - Choosing another Xcode

查看:36
本文介绍了在终端中构建 Xcode 项目 - 选择另一个 Xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have two different Xcode version installed on the same mac (Xcode 4 and Xcode 5). Xcode 4 is in the Applications folder. So whenever I build any projects from the terminal, naturally it compiles by using Xcode 4. Is there any way to use Xcode 5 (which is in desktop) to build a project from the terminal?

推荐答案

我认为命令 xcode-select 正是出于这个原因.

I think the command xcode-select is here for this precise reason.

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 项目 - 选择另一个 Xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆