Cocoapods官方文档探究
pod install 与 pod update 的区别
pod install
This is to be used the first time you want to retrieve the pods for the project, but also every time you edit your Podfile to add, update or remove a pod.
pod update
When you run
pod update PODNAME, CocoaPods will try to find an updated version of the podPODNAME, 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 yourPodfile).
Podfile.lock起什么作用
This file is generated after the first run of pod install, and tracks the version of each Pod that was installed.
CocoaPods will honour the Pod version in Podfile.lock unless the dependency is updated in the Podfile or pod update is called (which will cause a new Podfile.lock to be generated).
也就是说,只要Podfile.lock中存在某个Pod的版本,pod install就会拉取这个版本,只有pod update才会更新Podfile.lock里的版本号。