관리 메뉴

김종권의 iOS 앱 개발 알아가기

[iOS - swift] M1 맥북에서 HomeBrew, Cocoapods 설치 방법 본문

빌드 환경 설정

[iOS - swift] M1 맥북에서 HomeBrew, Cocoapods 설치 방법

jake-kim 2021. 11. 14. 03:00

Cocoapod을 HomeBrew로 설치

  • (Arm cpu인 경우) HomeBrew 설치 
$ arch -x86_64 zsh
$ cd /usr/local && mkdir homebrew
$ curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
  • (Intel cpu인 경우)HomeBrew 설치
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • cocoapods 설치
    • finder > 응용 프로그램 > 유틸리티 > 터미널 앱 오른쪽 마우스 클릭

> 정보 가져오기 > Rosetta를 사용하여 열기 체크

  • cocoapods 설치 (2가지 방법 존재)
  • 첫 번째 방법) brew로 rbenv를 설치 -> ruby 패키지 도구(bundler) 설치 -> brew bundle 입력하여 설치
    • brew로 rbenv를 설치
      brew install rbenv ruby-build
      echo 'eval "$(rbenv init -)"' >> ~/.zshrc
      rbenv install 2.6.4 # 최신 버전 명시
      rbenv global 2.6.4  # 위 버전
    • root project로 이동 후 ruby 설치
      gem install bundler​
    • ruby 패키지 도구(bundler) 설치
      cd path/to/project
      gem install bundler​
  • 두 번째 방법) 명령어로 바로 설치
$ arch -x86_64 /usr/local/homebrew/bin/brew install cocoapods
  • podifle이 존재하는 곳에서 pod install 실행 시 정상적으로 설치 완료

Comments