Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In fact, why does CocoaPods not install the latest version of pods?

Tags:

cocoapods

Note - actually apparently it does. Use the syntax Marcelo explains. Hope it helps someone!


With CocoaPods, you basically do this,

pod 'GTScrollNavigationBar', '~>0.1.1'

for example,

and it will install 0.1.1 of 'GTScrollNavigatorBar'. That's fantastic.

However - why does it not simply update 'GTScrollNavigatorBar' when a new release is available?

like image 280
Fattie Avatar asked Mar 09 '14 17:03

Fattie


People also ask

How do you update a pod with CocoaPods?

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).

What is the latest version of CocoaPods?

1.11. 2 - September 13, 2021 (287 KB)

Does pod install update?

You added a new pod to your Podfile This will install the latest version* of any new pods added to your Podfile, leaving your other pods unchanged. If you were to run pod update instead, it would install the new pods and update each of your existing pods to its latest version*.


3 Answers

Basically, it respects what you say in your Podfile.

You have several options (from CocoaPods guides):

  • > 0.1 Any version higher than 0.1
  • >= 0.1 Version 0.1 and any higher version
  • < 0.1 Any version lower than 0.1
  • <= 0.1 Version 0.1 and any lower version
  • ~> 0.1.2 Version 0.1.2 and the versions up to 0.2, not including 0.2

You can also provide no version at all, which will install always the latest available. Another option is provide a specific version, so that version will be always used.

like image 65
Marcelo Fabri Avatar answered Oct 05 '22 01:10

Marcelo Fabri


CocoaPods cached your current version of pods, so basically you have to clean cache.
You can make it locally in your project directory using this command:
pod cache clean --all

like image 40
Mykyta Savchuk Avatar answered Oct 05 '22 03:10

Mykyta Savchuk


Although I think it is very important to keep the project dependencies up-to-date I wouldn't recommend to auto update everything immediately.

I'm using VersionEye to get notified about new versions of my software dependencies. Good projects are using semantic versioning, which is a big help for updating. Most new releases are patches or minor versions, which means you can update with low risk. Every couple months major versions are coming out. Here you have to be careful with updating. It's very likely that a new major version will break your build. That's why you have to check the changelogs and migration paths. And don't forget to run your tests after you updated ;-)

If you want to learn about how to update right, check out the slides to continuous updating.

like image 39
Robert Reiz Avatar answered Oct 05 '22 03:10

Robert Reiz