【iOS Carthage】Carthage Build하면 화난 이야기.

소개



Cartfile에 따라 라이브러리를 설치하려고 carthage update프로젝트 폴더의 Carthage/Checkouts에는 github에서 복제 된 프로젝트가 들어 있었지만 Carthage/Build에 바이너리가 없었기 때문에 carthage build를 실행하여 Checkouts에서 바이너리를 생성하려고하면 화가났습니다.
$ carthage build
*** xcodebuild output can be found in /var/folders/1p/j83p750s5vg4h2h1f6j_l8yc0000gn/T/carthage-xcodebuild.dVzwMj.log
A shell task (/usr/bin/xcrun xcodebuild -project /Users/rin/Documents/Dev/Swift/PRX/prx-ios-beta/Carthage/Checkouts/Result/Result.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

해결까지의 길



에러 내용으로 구그하면 발견된 이 기사의 「순서②」에 따라 Xcode의 환경 설정상에서 Command Line Tools의 버젼을 선택해도 왠지 반영되지 않았다.


곤란하다면, 선택란 바로 아래에 2행 정도로 「 xcode-select 커멘드를 사용해 커맨드 라인으로부터에서도 변경할 수 있다」적인 것이 쓰여지고 있는 것을 깨닫고, 일찍 code-select . 그리고 아래의 기사를 참고로
  • xcode-select로 개발자 디렉토리 관리
  • Command Line Tools를 전환하는 방법

  • 경로를 확인해 보면, /Library/Developer/CommandLineTools/ 에 인스톨 되고 있는 Command Line Tools에 향하고 있었으므로,
    $ xcode-select --print-path
    /Library/Developer/CommandLineTools
    

    이것을 Xcode와 함께 설치된 Command Line Tools로 향하면,
    $ sudo xcode-select --switch /Applications/Xcode.app
    $ xcode-select --print-path
    /Applications/Xcode.app/Contents/Developer
    

    아래 이미지와 같이 Xcode 환경 설정에서 선택한 Command Line Tools 버전이 반영됩니다.


    다시 carthage build 실행하면 안전하게 다녔다! 좋았다.
    $ carthage build
    *** xcodebuild output can be found in /var/folders/1p/j83p750s5vg4h2h1f6j_l8yc0000gn/T/carthage-xcodebuild.qlR0Em.log
    *** Building scheme "Result-tvOS" in Result.xcodeproj
    *** Building scheme "Result-iOS" in Result.xcodeproj
    *** Building scheme "Result-Mac" in Result.xcodeproj
    *** Building scheme "Result-watchOS" in Result.xcodeproj
    *** Building scheme "APIKit" in APIKit.xcworkspace
    

    좋은 웹페이지 즐겨찾기