61

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'

Mobile Developer
  • 5,730
  • 1
  • 39
  • 45
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277

5 Answers5

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

Miro
  • 5,307
  • 2
  • 39
  • 64
22

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

BennyTheNerd
  • 3,930
  • 1
  • 21
  • 16
3

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

davbryn
  • 7,156
  • 2
  • 24
  • 47
2

You can try to use update command https://guides.cocoapods.org/terminal/commands.html#pod_update

pod update [POD_NAMES ...]

Updates the Pods identified by the specified POD_NAMES. If no POD_NAMES are specified it updates all the Pods ignoring the contents of the Podfile.lock.

Alena
  • 1,080
  • 12
  • 20
1

When starting out with a project it is likely that you will want to use the latest version of a Pod. If this is the case, simply omit the version requirements.

pod 'SSZipArchive'

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.

pod 'Objection', '0.9'

More info http://guides.cocoapods.org/syntax/podfile.html#pod

nspavlo
  • 377
  • 3
  • 12