Nice programing

xcrun 개발자 경로 변경

nicepro 2020. 11. 25. 21:10
반응형

xcrun 개발자 경로 변경


xcrun이 가리키는 디렉토리를 어떻게 변경할 수 있습니까? 현재 가리키는

xcrun : 오류 : 활성 Xcode 경로 '/Volumes/Xcode/Xcode44-DP7.app/Contents/Developer'를 표시 할 수 없습니다. (해당 파일 또는 디렉토리 없음)

위치를 변경해야합니다. 감사합니다.


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

xcode-select -switch기본적으로 사용중인 Xcode 버전을 선택하는 데 사용 합니다.


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

제 경우에는 다음을 수행해야했습니다.

  1. Xcode의 명령 줄 도구를 설치하고 기본 설정 -> 위치 로 이동 한 다음 명령 줄 도구에 올바른 값을 설정합니다 .
  2. 에서 다운로드 -> 구성 요소 탭 , I라는 줄에 설치 클릭 명령 행 도구 .
  3. Marmalade는 Xcode에서 잘 작동하기 시작했습니다.

이 명령을 실행하는 경우 :

$ 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

xcode를 열고 기본 설정으로 이동하십시오 ...

여기에 이미지 설명 입력

명령 줄 도구에서 xcode 위치를 선택합니다.

여기에 이미지 설명 입력 그 후 터미널에서 명령을 수행하십시오.


또는 대신 DEVELOPER_DIR 환경 변수를 재정의합니다.

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

이 설정은 각 사용자 계정에 고유합니다. 있는 경우 xcode-select선택 사항을 재정의합니다 .

선택 사항 : .bash_profile 파일을 편집하여 로그인 세션간에 지속되도록 할 수 있습니다.


터미널을 통해 Git Clone을 얻으려고했습니다.

  1. User-Mac-mini : ~ user_name $ cd / Users / yser_name / Documents / Developer / Xcode_Projects / Xcode_Proj / AAG / EJ

  2. user-Mac-mini:EJ user_name$ git clone https://smaplebitbucket.org/projectname/sample.git

I got below error:

xcrun: error: active developer path ("/Applications/Xcode 8.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

Intially I had two xcode 7.3 and 8.0. I kept name of xcode for 7.0 and xcode 8 for 8.0.

I deleted the xcode for 7.0 from Applications and rename xcode 8 to xcode.
In Xcode preference it was poiting to location xcode 8 but it was not there.

I changed the location using command :

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

Git Command worked and i was able to download the project from GIT.

you can also do it from Xcode preference too.

여기에 이미지 설명 입력

It worked.


sudo xcode-select --switch /Library/Developer/CommandLineTools works for me.

For your information I screw up my config with this :

 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'"

참고 URL : https://stackoverflow.com/questions/11456918/change-xcrun-developer-path

반응형