Skip to main content

Cocoapods Guide

·1 min

CocoaPods is an application level dependency manager for Objective-C, Swift projects.

Installing CocoaPods #

  1. Update RubyGems sudo gem update —system

  2. Install CocoaPods sudo gem install cocoapods

  3. You may get this prompt during the install process: rake’s executable “rake” conflicts with /usr/bin/rake Overwrite the executable? [yN] enter y

  4. Complete Setup pod setup

SETUP PROJECT:

  1. cd
  2. pod init
  3. open -a Xcode Podfile
  4. pod install

List all pods which have newer versions than the ones listed in the Podfile.lock #

$ pod outdated

Update to newer version #

$ pod update

or

$ pod update <pod-name>

How to fix initial long running setup process #

Manually download the master repo or clone using git.

$ cd ~/.cocoapods/repos
$ git clone --depth 1 https://github.com/CocoaPods/Specs.git master

install pod without updating the master repo #

$ pod install --no-repo-update

Register in cocoapod #

pod trunk register <email>

Submit podspec #

pod trunk push <NAME>.podspec

Lint podspec #

pod spec lint <NAME>.podspec or pod spec lint

Lint Library pod lib lint