65

xcrun が指しているディレクトリを変更するにはどうすればよいですか? 現在指している

xcrun: エラー: アクティブな Xcode パス '/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer' を統計できませんでした。(そのようなファイル、又はディレクトリはありません)

場所を変える必要があります。ありがとうございました。

4

11 に答える 11

194
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
于 2012-10-01T12:32:36.683 に答える
45

デフォルトで使用xcode-select -switchしている Xcode のバージョンを選択するために使用します。

于 2012-07-12T17:11:52.537 に答える
14

私の場合、私はしなければなりませんでした:

  1. Xcode のコマンド ライン ツールをインストールし、 [設定] -> [場所]に移動して、 [コマンド ライン ツール]に正しい値を設定します。
  2. Downloads -> Components タブで、 Command Line toolsという行の install をクリックしました。
  3. Marmalade は Xcode で正常に動作するようになりました。
于 2012-10-17T10:00:15.613 に答える
11

このコマンドを実行すると:

$ xcode-select -p

以下のように画面に出力されます。

/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer (あなたの場合)

デフォルトに変更するには、次のようにします。

$ sudo xcode-select -r
Password:

再び確かめる:

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

詳細については、次を参照してください。

$ 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
于 2014-06-17T04:50:47.247 に答える
10

Xcode を開き、設定に移動します...

ここに画像の説明を入力

コマンド ライン ツールから xcode の場所を選択します。

ここに画像の説明を入力 その後、ターミナルからコマンドを実行します。

于 2016-08-02T03:53:43.727 に答える
7

または、代わりに DEVELOPER_DIR 環境変数をオーバーライドします。

export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

この設定は、各ユーザー アカウントに固有です。xcode-select存在する場合は、選択をオーバーライドします。

オプション: .bash_profile ファイルを編集することで、これをログイン セッション間で持続させることができます。

于 2013-03-17T00:22:24.643 に答える
0

sudo xcode-select --switch /Library/Developer/CommandLineTools は私にとってはうまくいきます。

参考までに、これで設定を台無しにします:

 sw_vers -productVersion | grep -E '^10\.([89]|10)' >/dev/null && bash -c "[ -d /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain ] && sudo -u $(ls -ld /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain | awk '{print $3}') bash -c 'ln -vs XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain' || sudo bash -c 'mkdir -vp /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain/usr && for i in bin include lib libexec share; do ln -s /usr/${i} /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain/usr/${i}; done'"
于 2015-02-23T15:59:45.200 に答える