'pod install' doesn't update an existing pod

前端 未结 4 522
广开言路
广开言路 2021-01-31 14:57

I am trying to update my pod using pod install and finding that it doesn\'t update properly unless I delete the original pod.

Is t

4条回答
  •  无人及你
    2021-01-31 15:43

    I think reader of this Question must understand difference between

    pod install vs. pod update

    Many people starting with CocoaPods seems to think that pod install is only used the first time you setup a project using CocoaPods and pod update is used afterwards. But that's not the case at all.

    • Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
    • Use pod update [PODNAME] only when you want to update specific pod to a newer version.
    • Use pod update only when you want to update every pod to a newer available version.

    Every time the pod install command is run — and downloads and install new pods — it writes the version it has installed, for each pods, in the Podfile.lock file. This file keeps track of the installed version of each pod and locks those versions. When you run pod install, it only resolves dependencies for pods that are not already listed in the Podfile.lock. For pods listed in the Podfile.lock, it downloads the explicit version listed in the Podfile.lock without trying to check if a newer version is available For pods not listed in the Podfile.lock yet, it searches for the version that matches what is described in the Podfile (like in pod 'MyPod', '~>1.2')

提交回复
热议问题