
🍎 CocoaPods란?
마치 Unity에서 Package Manager로 TextMeshPro나 Addressables 같은 걸 설치하는 것처럼,
iOS에서는 CocoaPods를 사용해서 Firebase, Kakao SDK, GoogleSignIn, Alamofire 등 수많은 외부 라이브러리를 쉽게 가져다 쓸 수 있다.
🔧 CocoaPods가 왜 필요한가?
pod 'Firebase/Auth', '10.3.0'
pod 'KakaoSDK', Firebase도 pod 'Firebase/Core'📦 CocoaPods 작동 방식 간단 요약
pod init: Podfile이 없을 때 사용하는 명령어 (초기 설정용)pod install: Podfile이 이미 존재할 때 실행하여 라이브러리를 설치함Podfile 파일 생성: 내가 사용할 라이브러리를 선언.pod install: 선언한 라이브러리를 다운로드 + 설치..xcworkspace 생성: Xcode 프로젝트 + Pods 통합된 워크스페이스..xcworkspace 열기: 실제 앱 실행은 이 파일 기준으로 이뤄져야 함.cd MyUnityIOSProject/
pod init # → Podfile 생성 (빈 상태)
vim Podfile # → 원하는 SDK 추가 (예: pod 'Firebase/Auth')
pod install # → SDK 실제 설치 및 .xcworkspace 생성
open MyProject.xcworkspace
pod init 실행 전bash
복사편집
$ ls
Unity-iPhone.xcodeproj
pod init 실행 후bash
복사편집
$ ls
Unity-iPhone.xcodeproj
Podfile 👈 생성됨
Podfile 내용 추가 후ruby
복사편집
target 'Unity-iPhone' do
pod 'Firebase/Auth'
end
pod install 실행 후bash
복사편집
$ ls
Unity-iPhone.xcodeproj
Podfile
Podfile.lock
Pods/ 👈 설치된 라이브러리
Unity-iPhone.xcworkspace 👈 이걸로 Xcode 열어야 함
Packages/manifest.json → iOS의 Podfilepod install.xcworkspace 생성으로 반영됨