Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install multiple version of cocoa pods

Tags:

ios

cocoapods

Is it possible to install multiple versions of cocoa pods on the same machine ? I need one project to be build from cocoa pod 0.33 and another one from the latest version. Is this possible ?

like image 993
rustylepord Avatar asked Mar 10 '15 11:03

rustylepord


People also ask

How do you update all pods?

Make sure your imagePullPolicy is set to Always(this is the default). That means when a pod is deleted, a new pod will ensure it has the current version of the image. Then refresh all your pods. The simplest way to refresh all your pods is to just delete them and they will be recreated with the latest image.

How do I specify pod version?

<Specifying pod versions Later on in the project you may want to freeze to a specific version of a Pod, in which case you can specify that version number. Besides no version, or a specific one, it is also possible to use logical operators: '> 0.1' Any version higher than 0.1. '>= 0.1' Version 0.1 and any higher version.

How do I uninstall pod and install again?

Just rm -rf that pod's folder, and remove the line from the Podfile. Then run pod install again.

How do you update a single pod?

$ pod update When you run pod update SomePodName , CocoaPods will try to find an updated version of the pod SomePodName, without taking into account the version listed in Podfile. lock . It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).


2 Answers

I've made a small list of commands to use multiple versions of cocoapods, all tested with osx sierra 12.1, xCode 8

  • View all installed versions of cocoapods :

    gem list --local | grep cocoapods

  • Install a specific version of cocoapods with gem

    gem install cocoapods -v 0.33.0

  • Install pods with specific version of cocoapods (change to your wanted version):

    pod _0.33.0_ install

All versions of Cocoapods can be found HERE

like image 109
Steven B. Avatar answered Sep 17 '22 22:09

Steven B.


When you install new version of cocoapods, the old one is not removed unless you explicitly remove it with

gem uninstall cocoapods

and select the version to be removed.

You can use the old versions by giving version number in the command, surrounded by underscores, like this:

 pod _0.38.2_ install

Since November 11, 2016 the master repo is not compatible with the old version and unless you have updated your Podfile correctly (replaced source "https://github.com/CocoaPods/Specs.git" with source "https://github.com/CocoaPods/Old-Specs" or just added the latter one) you will see an error when using 0.x version of cocoapods:

"[!] The master repo requires CocoaPods 1.0.0 -  (currently using 0.38.2)"

Information on how and why is here.

like image 31
diidu Avatar answered Sep 16 '22 22:09

diidu