I understand that the following command will update a single pod: pod update <podname>
. However this also updates the dependencies of other pods (pods that were not included in the update command) that you have previously installed. Is there a way to update a single pod and leave all other dependencies alone?
Make sure you have the latest version of CocoaPods installed. $ pod update POD
was introduced recently.
See this issue thread for more information:
$ 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 inPodfile.lock
. It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).If you run pod update without any pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.
To install a single pod without updating existing ones-> Add that pod to your Podfile and use:
pod install --no-repo-update
To remove/update a specific pod use:
pod update POD_NAME
Tested!
It's 2015
So because pod update SomePod
touches everything in the latest versions of cocoapods, I found a workaround.
Follow the next steps:
Remove
SomePod
from thePodfile
Run
pod install
pods will now remove SomePod
from our project and from the Podfile.lock
file.
Put back
SomePod
into thePodfile
Run
pod install
again
This time the latest version of our pod will be installed and saved in the Podfile.lock
.
just saying:
pod install
- for installing new pods,
pod update
- for updating existing pods,
pod update podName
- for updating only specific pod without touching other pods,
pod update podName versionNum
- for updating / DOWNGRADING specific pod without touching other pods
Just a small notice.
pod update POD_NAME
will work only if this pod was already installed. Otherwise you will have to update all of them with
pod update
command
I'm using cocoapods version 1.0.1
and using pod update name-of-pod
works perfectly. No other pods are updated, just the specific one you enter.
This is a bit of an outlier and not likely to be what the OP was dealing with, but pod update <podname>
will not work in all cases if you are using a local pod on your computer.
In this situation, the only thing that will trigger pod update
to work is if there is a change in the podspec file. However, making a change will also allow for pod install
to work as well.
In this situation, you can just modify something minor such as the description or summary by one letter, and then you can run the install or update command successfully.
来源:https://stackoverflow.com/questions/26351086/how-to-update-a-single-pod-without-touching-other-dependencies