更改xcrun开发者路径

the*_*end 62 xcode

如何更改xcrun指向的目录?目前正指向

xcrun:错误:无法统计活动的Xcode路径'/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer'.(没有相应的文件和目录)

我需要改变位置.谢谢.

Vai*_*ran 184

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)


Rob*_*ier 45

使用xcode-select -switch来选择你默认情况下使用其的Xcode版本.

  • 在OSX Yosemite上使用`xcode-select --switch path/to/Xcode.app`. (2认同)

imx*_*ylz 16

sudo xcode-select --switch /Library/Developer/CommandLineTools
Run Code Online (Sandbox Code Playgroud)


小智 14

在我的情况下,我不得不:

  1. 安装Xcode的命令行工具,转到首选项 - > 位置并为命令行工具设置正确的值.
  2. 下载 - > 组件选项卡中,我在名为命令行工具的行上单击安装.
  3. Marmalade开始与Xcode合作.


bio*_*inh 9

如果您运行此命令:

$ xcode-select -p
Run Code Online (Sandbox Code Playgroud)

它将打印到屏幕如下:

/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer(在您的情况下)

要将其更改为默认值,您可以执行以下操作:

$ sudo xcode-select -r
Password:
Run Code Online (Sandbox Code Playgroud)

再检查一遍:

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)

获取更多信息:

$ 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
Run Code Online (Sandbox Code Playgroud)


Ami*_*a シ 8

打开xcode并导航到首选项...

在此输入图像描述

从命令行工具中选择xcode的位置.

在此输入图像描述 之后从终端执行命令.


Aar*_*ger 6

或者,改为覆盖DEVELOPER_DIR环境变量:

export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
Run Code Online (Sandbox Code Playgroud)

此设置对每个用户帐户都是唯一的.如果存在,它将覆盖xcode-select选择.

可选:您可以通过编辑.bash_profile文件在登录会话之间保持此状态.