Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods how to install only one new library

I have a list of libraries in my Pod file. I decide to add new one to Pod file. But I want to keep all my previous libraies without updates and just install (add) this one library

pod 'JSAnimatedImagesView', '~> 1.0.0'

so pod update and pod install update all libraries to newer versions, but I don't want to update them just install pod 'JSAnimatedImagesView', '~> 1.0.0'

like image 548
Matrosov Oleksandr Avatar asked Feb 18 '15 17:02

Matrosov Oleksandr


People also ask

What command updates a single library in CocoaPods?

When you run pod update PODNAME , CocoaPods will try to find an updated version of the pod PODNAME , 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 ).


3 Answers

pod install --no-repo-update

This installs new items without updating existing repos (versioned or not).

It's also just quicker if you have a lot of repos and want a fast install of a new item.

like image 103
Miro Avatar answered Oct 24 '22 18:10

Miro


(As of March 15, 2019)

To install 1 new pod: add the 1 desired new pod into your Podfile. Then run:

pod install --no-repo-update

It will not update any other pods when running this.

like image 28
BennyTheNerd Avatar answered Oct 24 '22 18:10

BennyTheNerd


If you don't want to update the specific libraries you should lock them at the versions you want to keep

pod 'AFNetworking', '1.2.0'
pod 'JSAnimatedImagesView', '~> 1.0.0'

Would keep AFNetworking on V1.2.0 but get the latest JSAnimatedImagesView

This makes the podfile transferrable to other locations (and developers) and saves you from forgetting to revert your podfile until you intend to update pods

like image 39
davbryn Avatar answered Oct 24 '22 18:10

davbryn