How to install Carthage?

JiSNG·2020년 8월 25일
0

Install Carthage

  1. 먼저 $ brew update 해주세요.

  2. $ brew upgrade carthage
    (한 번도 carthage를 설치해 본 적 없다면, $ brew install carthage)

  3. Carthage를 설치 할 프로젝트로 갑니다.

  4. $ touch Cartfile

  5. Cartfile을 작성해주세요. (아래는 예시)

    • github "Liftric/DIKit" "master"
    • github "Alamofire/Alamofire" ~> 5.2.2
  6. $ carthage update

  7. 프로젝트를 열어서,

    1. Build Phase > Link Binary With Libraries > Add Files

    2. (파일 경로: 프로젝트 파일 > Cartahge > Build > iOS ) "라이브러리.framework" 파일 추가

    3. Build Phase > (프로젝트 우클릭) New Run Script Phase

    4. Shell 아래 텍스트 칸에 다음 문장을 복사합니다:

      /usr/local/bin/carthage copy-frameworks

    5. Input Files > + 버튼 클릭

    6. 다음 문장 양식을 지켜 입력합니다:

      $(SRCROOT)/Carthage/Build/iOS/라이브러리명.framework

Error

xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

위와 같은 에러가 난다면, 아래처럼 진행해주세요.

Xcode > Preferences > Locations > Command Line Tools 선택

profile
JiSNG+iOS

0개의 댓글