Skip to content

CocoaPods usage notes

Jinlian(Sunny) Wang edited this page Nov 6, 2015 · 2 revisions

CocoaPods is a popular way to manage xCode project dependencies. The followings are couple notes when using it.

  1. RayWenderlich Tutorials on CocoaPods

  2. The Central CocoaPods Sepcs Repo

  3. You can set up internal repo(also called Private Repo), but following the same format as in central repo, and host the spec on internal git repo, say Enterprise Github server. To add a private repo, use command pod repo add [repo name] [url to the repo in https] and pod repo remove [repo name] to remove it. The private repo spec is store under ~/.cocoapods/repos.

  4. If you have to work on both main project(referred as project M) and a pod project(referred as Project P), you can check out both projects, and then in the Podfile of the main project, you instruct CocoaPods to pull in the dependency of project P from local checkout instead by adding a line pod '[name of project P]', :path => '[path to project P's local checkout copy]', and then run pod update/install. After these steps, when you open the Project A workspace then you'll see a new group under the Pods project named 'Development Pods'. One of the pods in that group will be Project P.

  5. A nice tutorial from Use Your Loaf: Creating a CocoaPods. Use pod spec lint to make sure the spec contains no warnings and errors. To publish a CocoaPods to trunk service, call:

pod trunk register [email] "[Sunny Wang]"
pod trunk push [libname].podspec 
Clone this wiki locally