code

xcode-select 활성 개발자 디렉토리 오류

codestyles 2020. 10. 3. 10:42
반응형

xcode-select 활성 개발자 디렉토리 오류


npm installwhich를 실행할 때 다음 오류가 발생 node-gyp했지만 ... 이 필요한 모든 항목에 의해 트리거 될 수 있습니다 xcode-select.

xcode-select : 오류 : 'xcodebuild'도구에는 Xcode가 필요하지만 활성 개발자 디렉터리 '/ Library / Developer / CommandLineTools'는 명령 줄 도구 인스턴스입니다.

무엇이 문제입니까?


이 문제 xcode-select는 개발자 디렉토리가를 가리키고 /Library/Developer/CommandLineTools있을 때 전체 일반 Xcode가 필요할 때 발생합니다 (Xcode 이후 CommandLineTools가 설치된 경우 발생).

해결책:

  1. 아직 Xcode 가없는 경우 Xcode를 설치하십시오 ( https://developer.apple.com/xcode/에서 다운로드 ).
  2. 이용 약관에 동의하십시오.
  3. Xcode 앱이 /Applications디렉터리 에 있는지 확인합니다 (NOT /Users/{user}/Applications).
  4. xcode-select다음 명령을 사용하여 Xcode 앱 개발자 디렉토리를 가리 킵니다.
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

참고 : Xcode 앱 경로가 올바른지 확인하십시오.

  • Xcode : /Applications/Xcode.app/Contents/Developer
  • Xcode- 베타 : /Applications/Xcode-beta.app/Contents/Developer

Xcode를 설치하고 싶지 않은 사람들을위한 다른 솔루션 :

  1. 명령 줄 도구를 설치합니다 (아직 설치하지 않은 경우) :

    xcode-select --install

  2. 활성 디렉토리 변경 :

    sudo xcode-select -switch /Library/Developer/CommandLineTools

이것은 나를 위해 일했습니다 (git).


npm을 사용하여 패키지를 설치하는 동안 문제가 발생했습니다. 오류가 발생했습니다. "sudo xcode-select -s /Applications//Xcode.app/Contents/Developer/"

이 문제를 해결하려면

  • Xcode를 열었습니다.
  • 환경 설정
  • 위치
  • Command Lin 도구 선택 : Xcode 6.1.1

이제 npm으로 패키지를 설치할 때 더 이상 오류가 발생하지 않습니다.


Xcode-> 기본 설정-> 위치-> 명령 줄 도구

스크린 샷

옵션 선택 : Xcode 8.x


sudo xcode-select -r경로를 자동으로 재설정하는 실행 만하면 됩니다.

 -r, --reset
              Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism. This command must  be
              run with superuser permissions (see sudo(8)), and will affect all users on the system.

xcode 베타를 사용하는 경우 :

sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer

  1. Download Xcode from App Store.

  2. Go to Xcode preferences/Locations/CommandlineTools

    You just have to set it to the Xcode version. It automatically points to '/Application/Xcode.app'


I had to run this first

sudo xcode-select --reset

then

sudo xcode-select -switch /Library/Developer/CommandLineTools

and then it worked.


Install Xcode from App Store. After installing run xcodebuild with root privileges i.e. sudo xcodebuild and accept the language. After this npm install bcrypt worked like a charm!


Without Xcode: create file /usr/local/bin/xcodebuild with content to cheat XcodeSelect

  #!/bin/bash
  exit 0

chmod +x /usr/local/bin/xcodebuild


XCode2: sudo xcode-select -s /Applications/Xcode\ 2.app/Contents/Developer

Pay attention to the "\" to escape the space


I had two instance of Xcode installed xcode.app and xcode-beta.app When I tried to create a build with netbeans it showed me the error "supported version of xcode and command line tools not found netbeans"

I followed the following steps:

  1. "xcode-select --print-path" is equal to "/Applications/Xcode.app/Contents/Developer"
  2. "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform" exists
  3. "xcodebuild -version" starts with "Xcode"

after 1 I found that it is pointing me to xcode-beta.app

so here is the solution which worked like a charm:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


I was having the same problem in high sierra. running the following command solved it npm explore npm -g -- npm install node-gyp@latest


if you are using xcode beta

use

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

instead of

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer


sudo xcode-select -s /Applications/Xcode 10.app/Contents/Developer

languoguangs-iMac:/ languoguang$ sudo xcode-select -s /Applications/Xcode 10.app/Contents/Developer
xcode-select: error: invalid argument '10.app/Contents/Developer'
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
  --install                   open a dialog for installation of the command line developer tools
  -v, --version               print the xcode-select version
  -r, --reset                 reset to the default command line tools path
languoguangs-iMac:/ languoguang$ sudo xcode-select -s "/Applications/Xcode 10.app/Contents/Developer"

because my Xcode name in Application is "Xcode 10",

sudo xcode-select -s "/Applications/Xcode 10.app/Contents/Developer"

works.


오늘은 2019 년 1 월 28 일입니다. MAC에서 두 가지 작업을 수행했습니다.

[1] sudo xcode-select --install

[2] Restart the Mac

컴퓨터를 다시 시작할 때까지 Android Studio에 문제가 계속 표시되었습니다. 재부팅 후 정상적으로 작동했습니다. (다른 사람들이하는 것처럼 스위치 명령을하지 않았습니다). 도움이 되었기를 바랍니다.

참고 URL : https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error

반응형