Warning: Xcode alone is not sufficient on Mojave.

12654 단어 Xcodehomebrew

이벤트 : xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)


  • 환경
  • macOS Big Sur 버전 11.1
  • Homebrew 2.7.1

  • % brew update
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    Updated 3 taps (homebrew/core, homebrew/cask and homebrew/cask-fonts).
    #...省略...
    

    원인 : OS 업데이트에서 XCode의 CommandLineTools / usr 디렉토리의 bin 디렉토리가 분실되었기 때문에?



    빙글빙글보고 몇 개의 사이트를 보면 OS의 업데이트 후에 얼마 안되는 것 같다.
    # おぉ、エラーメッセージにあるbinディレクトリがない!
    % ls -la /Library/Developer/CommandLineTools/usr
    total 0
    drwxr-xr-x  3 root  wheel  96 12 16 19:42 .
    drwxr-xr-x  3 root  wheel  96 12 16 19:42 ..
    drwxr-xr-x  3 root  wheel  96 12 16 19:42 share
    

    해결책 : xcode-select 설치


  • xcode-select 설치
  • 명령에 표시된 대화 상자에 따라 설치



  • 오류가 사라졌는지 확인
  • # xcode-selectをダイアログに従ってインストールする
    % xcode-select --install
    xcode-select: note: install requested for command line developer tools
    
    # エラーが消えたか確認する
    % brew update
    Updated 1 tap (homebrew/core).
    No changes to formulae.
    

    이벤트 : Warning: Xcode alone is not sufficient on Mojave.


  • 환경
  • macOS Mojave 버전 10.14.5
  • Homebrew 2.1.6

  • $ brew doctor
    Please note that these warnings are just used to help the Homebrew maintainers
    with debugging if you file an issue. If everything you use Homebrew for is
    working fine: please don't worry or file an issue; just ignore this. Thanks!
    
    Warning: No developer tools installed.
    Install the Command Line Tools:
      xcode-select --install
    
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    
    Warning: Xcode alone is not sufficient on Mojave.
    Install the Command Line Tools:
      xcode-select --install
    

    원인 : Xcode.app를 삭제했기 때문에



    애초에 Xcode.app를 삭제한 것이 일의 시작이었을 것이다···.
    Mac에서 Xcode는 중요한 것이었던 것 같다 ... 포기하고 설치한다.

    해결책 : xcode-select 설치


  • Command Line Tools 설치

  • Apple 사이트 에서 dmg 파일 다운로드
  • pkg를 클릭하고 대화 상자에 따라 설치

  • xcode-select 설치하기
  • 명령으로 표시된 대화 상자를 따라 진행하여 설치합니다.

  • Warning이 사라졌는지 확인
  • # xcode-selectをインストールする
    $ xcode-select --install
    xcode-select: note: install requested for command line developer tools
    
    # Warningが消えたか確認する
    $ brew update
    Already up-to-date.
    $ brew doctor
    Your system is ready to brew.
    

    실패한 대응 : Xcode는 사용하지 않기 때문에 제거


  • 첫 번째 고찰 : "Xcode를 사용하려면 명령 줄 도구 필요"> "Xcode를 사용하지 않기 때문에 제거"
  • 이전에 Xcode.app/Applications 에서 삭제했지만 불충분했던 모양.

  • 고찰로부터의 대응 : Xcode 관련의 파일을 삭제해 간다.
  • 참고


  • # /Library/Preferences/配下
    $ find /Library/Preferences/ -type f | grep -i xcode
    /Library/Preferences//com.apple.dt.Xcode.plist
    $ find /Library/Preferences/ -type f | grep -i xcode | sudo xargs rm
    $ find /Library/Preferences/ -type f | grep -i xcode
    $
    
    # ~/Library/Preferences/配下
    $ find Library/Preferences/ -type f | grep -i xcode
    Library/Preferences//com.apple.dt.xcodebuild.plist
    Library/Preferences//com.apple.dt.Xcode.plist
    Library/Preferences//com.apple.preferences.extensions.XcodeSourceEditor.plist
    Library/Preferences//com.apple.preferences.extensions.XcodeSourceControlHost.plist
    $ find Library/Preferences/ -type f | grep -i xcode | xargs rm
    $ find Library/Preferences/ -type f | grep -i xcode
    $ 
    
    # ~/Library/Caches/com.apple.dt.Xcode/配下
    $ find Library/Caches/ -type f | grep -i xcode
    Library/Caches//com.apple.dt.Xcode/fsCachedData/70D9F1CB-B3B7-4605-AD98-4C911D694D14
    Library/Caches//com.apple.dt.Xcode/Cache.db-shm
    Library/Caches//com.apple.dt.Xcode/Cache.db-wal
    Library/Caches//com.apple.dt.Xcode/Cache.db
    $ find Library/Caches/ -type d | grep -i xcode | xargs rm -rf
    $ find Library/Caches/ -type f | grep -i xcode
    $
    
    # ~/Library/Application Support/com.apple.sharedfilelist/配下
    $ find Library/Application\ Support/com.apple.sharedfilelist/ -type f | grep -i xcode | sed -e 's/ /\\ /g'
    Library/Application\ Support/com.apple.sharedfilelist//com.apple.LSSharedFileList.ApplicationRecentDocuments/com.apple.dt.xcode.sfl
    Library/Application\ Support/com.apple.sharedfilelist//com.apple.LSSharedFileList.ApplicationRecentDocuments/com.apple.dt.xcode.sfl2
    $ find Library/Application\ Support/com.apple.sharedfilelist/ -type f | grep -i xcode | sed -e 's/ /\\ /g' | xargs rm
    $ find Library/Application\ Support/com.apple.sharedfilelist/ -type f | grep -i xcode
    $ 
    
    # ~/Library/Application Support/Xcodeディレクトリ
    $ find Library/Application\ Support/ -maxdepth 1 -type d | grep -i xcode
    Library/Application Support//Xcode
    $ find Library/Application\ Support/ -maxdepth 1 -type d | grep -i xcode | sed -e 's/ /\\ /g' | xargs rm -rf
    $ find Library/Application\ Support/ -maxdepth 1 -type d | grep -i xcode
    $ 
    
    # ~/Library/Developer/Xcodeディレクトリ
    $ find Library/Developer/ -maxdepth 1 -type d | grep -i xcode
    Library/Developer//Xcode
    $ find Library/Developer/ -maxdepth 1 -type d | grep -i xcode | sed -e 's/ /\\ /g' | xargs rm -rf
    $ find Library/Developer/ -maxdepth 1 -type d | grep -i xcode
    
    # ~/Library/Developer/CoreSimulator/配下にはなかった
    $ find Library/Developer/CoreSimulator/ -type f | grep -i xcode
    $
    
    # 今一度doctorする
    $ brew doctor
    Please note that these warnings are just used to help the Homebrew maintainers
    with debugging if you file an issue. If everything you use Homebrew for is
    working fine: please don`t worry or file an issue; just ignore this. Thanks!
    
    Warning: No developer tools installed.
    Install the Command Line Tools:
      xcode-select --install
    
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    
    Warning: Xcode alone is not sufficient on Mojave.
    Install the Command Line Tools:
      xcode-select --install
    
    # がーーん、だめだった・・・じゃ、update・・・で悪化していることに気がついた
    $ brew update
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
    # 省略
    

    좋은 웹페이지 즐겨찾기