programing

xcode 활성 개발자 디렉토리 선택 오류

newstyles 2023. 5. 4. 19:42

xcode 활성 개발자 디렉토리 선택 오류

▁an를 할 때 다음 오류가 했습니다.npm install 한 것node-gyp하지만 필요한 모든 것에 의해 촉발될 수 있습니다.xcode-select.

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

뭐가 문제야?

이 문제는 다음과 같은 경우에 발생합니다.xcode-select가 개자디리있었다니습고가발을 ./Library/Developer/CommandLineTools전체 일반 Xcode가 필요한 경우(Xcode 이후에 CommandLineTools가 설치된 경우 발생)

솔루션:

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

참고: Xcode 앱 경로가 올바른지 확인합니다.

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

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

이 문제 해결

  • Xcode를 열었습니다.
  • 우선권
  • 위치
  • 명령줄 도구 선택: Xcode 6.1.1

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

Xcode를 설치하지 않으려는 사용자를 위한 다른 솔루션:

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

    xcode-select --install

  2. 활성 디렉토리를 변경합니다.

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

이것은 저에게 효과가 있었습니다.

Xcode > 환경설정 > 위치 > 명령줄 도구

스크린샷

Xcode 버전과 일치하는 옵션을 선택합니다.

순단실을 합니다.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.

방금 다음 명령을 실행하여 문제가 해결되었습니다.

sudo xcode-select --reset

단말기에 입력합니다.

xcode-select --install
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept

XCode를 이미 설치한 경우 다음 작업만 수행하면 됩니다.

  • XCode 열기
  • Xcode > 환경설정 > 위치로 이동
  • 명령줄 도구에서 XCode를 선택합니다.

xcode 베타를 사용하는 경우:

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

내가 먼저 이걸 실행해야 했습니다.

sudo xcode-select --reset

그리고나서

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

그리고 효과가 있었습니다.

  1. 앱스토어에서 Xcode를 다운로드합니다.

  2. Xcode 기본 설정/위치/명령줄로 이동합니다.도구들

    당신은 그것을 Xcode 버전으로 설정하기만 하면 됩니다.자동으로 '/Application/Xcode.app'을 가리킵니다.

하이 시에라에서도 같은 문제를 겪고 있었습니다. 다음 명령을 실행하면 해결되었습니다.

npm explore npm -g -- npm install node-gyp@latest

단순 다시 설치 xcode 선택

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

아래 단계를 따르십시오.

  1. Xcode의 최신 버전은 https://developer.apple.com/xcode/download/ 에서 다운로드할 수 있습니다.
  2. 별도로 지정하지 않는 한 '다운로드'에 다운로드됩니다.Xcode를 다운로드하여 압축을 푼 경로를 반드시 확인하시기 바랍니다.
  3. 이제 다운로드된 다른 응용 프로그램과 달리, 추출 시 Xcode는 응용 프로그램으로 이동하는 옵션을 제공하지 않습니다.
  4. XCODE-ACTUAL-LOCATION을 기록하거나 애플리케이션으로 이동합니다.
  5. Xcode 또는 Xcode-beta를 다운로드했는지 확인합니다.

4 및 5를 기준으로 다음 명령 중 하나를 실행합니다(위 설명을 읽지 않고 모든 명령을 실행하지 마십시오).

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
sudo xcode-select -s /[XCODE-ACTUAL-LOCATION]/Xcode.app/Contents/Developer
sudo xcode-select -s /[XCODE-ACTUAL-LOCATION]/Xcode-beta.app/Contents/Developer

앱스토어에서 Xcode를 설치합니다.설치 후 루트 권한으로 xcodebuild를 실행합니다. sudo xcodebuild그리고 언어를 받아들입니다. 다음에 이에후npm install bcrypt매력적으로 작동했습니다!

미포함 : file Xcode 사용함 : 파일만기들안/usr/local/bin/xcodebuild XcodeSelect는 Xcode입니다.

  #!/bin/bash
  exit 0

chmod +x /usr/local/bin/xcodebuild

Xcode 베타를 사용하는 경우 실행

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

대신에

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

나는 완전한 Xcode 어플리케이션을 설치하지 않고 이 오류를 해결할 수 있었습니다.그러나 xcode 명령줄 도구를 설치해야 합니다.

여기서:

  1. $ cd /usr/bin
  2. $ sudo mv xcodebuild xcodebuild.orig의 경우를
  3. $ vim xcodebuild
  4. 다음을 붙여넣습니다.
#!/bin/bash
if [[ $1 == '-version' ]]; then
  echo "Xcode 10.2.1"
  echo "Build version 10E1001"
else
  /usr/bin/xcodebuild.bak $@
fi
  1. $ sudo chmod +x xcodebuild

XCode2: sudoxcode-select -s /Applications/Xcode\ 2.app/콘텐츠/개발자

공간을 탈출하기 위해 "\"에 주목합니다.

xcode.app과 xcode-beta.app 두 개의 Xcode 인스턴스를 설치했습니다. netbeans로 빌드를 생성하려고 하면 "지원되는 xcode 버전 및 명령줄 도구에서 netbeans를 찾을 수 없습니다."라는 오류가 표시되었습니다.

다음 단계를 수행했습니다.

  1. "xcode-select --print-path"는 "/Applications/Xcode.app/Contents/Developer"와 같습니다.
  2. "/Applications/Xcode.app/콘텐츠/개발자/Platforms/iPhoneSimulator.platform"이 존재합니다.
  3. "xcodebuild -version"은 "Xcode"로 시작합니다.

1 후에 나는 그것이 나를 xcode-beta.app으로 가리키고 있다는 것을 발견했습니다.

그래서 여기 매력적으로 작동한 해결책이 있습니다.

sudoxcode - s /Applications/Xcode.app/콘텐츠/개발자

오늘은 2019년 1월 28일입니다.

Mac에서 이 문제를 해결하기 위해 두 가지 작업을 수행했습니다.

  1. 터미널에서 다음 명령을 실행합니다.
    sudo xcode-select --install

  2. Mac을 다시 시작합니다.

컴퓨터를 다시 시작할 때까지 안드로이드 스튜디오에서 계속 문제가 발생했습니다.재부팅 후에는 정상적으로 작동했습니다.또한 다른 사람들처럼 명령을 실행하지 않았습니다.이것이 도움이 되길 바랍니다.

수동으로 명령줄 도구를 설치하는 것이 도움이 되었습니다.

  1. 앱스토어를 통해 xcode를 설치했습니다.
  2. 여전히 홈브루를 다운로드할 수 없습니다.
  3. 링크를 통해 수동으로 명령줄 도구를 설치했습니다.
  4. 빙붕

https://developer.apple.com/download/more/ ?= 명령 %20line%20 도구

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"

왜냐하면 애플리케이션의 내 Xcode 이름이 "Xcode 10"이기 때문입니다.

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

작동하다.

저 같은 경우에는.

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

내 Xcode에 특별한 이름이 있어서 작동하지 않았습니다.e) Xcode_11.2.0_beta_2_stackoverflow.app

cd /applications
ls

그런 다음 Xcode 이름을 찾은 다음

sudo xcode-select -s /Applications/{myXcodeName}.app/Contents/Developer 

그것은 나에게 효과가 있었다.

위의 어떤 것도 저에게 효과가 없었습니다.저는 원래 명령줄 도구를 별도로 설치한 다음 Xcode를 모두 설치했습니다.여기에 표시된 것처럼 명령줄 도구를 제거하는 것이 효과적이었습니다.그 다음, 달리려고 할 때.xcode-select다시, 저는 그것들을 다시 설치하라는 요청을 받았습니다.

이 그 제가 라이브러리를 입니다. (특히 **************)gcc)와 함께macports오래된 명령줄 도구를 사용한 것으로 추정되며, 개발 도중에 X코드 전체를 설치했습니다.저 그서어, 저경우의, 다설했야다, 습니치해시저는든쨌래를 다시 설치해야 .macports도구를 한 후 설치하는 " " " " " ", " ", " " ", " ", " ", ", ", ", "gcc그리고 제 편집이 작동했습니다.

두 단계만 필요하며 전체 XCode.app은 전혀 필요하지 않습니다.

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

이 때 "Installing Softwref" 대화상자가 나타납니다.

여기에 이미지 설명 입력

바로 그거야!

위의 어떤 해결책도 저에게 도움이 되지 않았습니다.이전 프로젝트에서 작업하던 중 컴퓨터에 최신 버전의 NodeJs(v14.x)가 설치되어 있었습니다.

10.1.x 이상의 노드 버전은 작동하지 않았으며 테스트할 때 위와 같은 오류가 발생했습니다.

해결책

  • nvm과 같은 nodeJs 버전 관리자인 "n"을 설치했습니다.
  • nodeJs 버전을 9.x로 다운그레이드했습니다.
  • npm install이제 작동합니다.

이제 버전을 업데이트하거나 package.json에서 노드 버전을 지정해야 합니다.

최신 버전의 Xcode(V14.3 사용)를 사용하는 사용자의 경우 명령줄 도구를 설치해야 합니다.두 가지 방법을 제안합니다.

  1. 터미널에서 다음 명령을 실행합니다.

xcodebuild -runFirstLaunch xcode-select --install

  1. 또는 이 링크에서 설치 가능한 DMG 파일(Xcode v14.3용 명령줄 도구)을 다운로드하여 설치합니다.

새로운 mac v13.3에 brew를 설치하려고 할 때 이 문제를 발견했습니다.

저에게 효과가 있었던 간단한 해결책은 Xcode.app을 현재 위치(내 경우 다운로드)에서 Applications로 드래그 앤 드롭하는 것입니다.

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