0%

Cocoapods官方文档探究

Cocoapods官方文档探究

官方文档链接


pod installpod 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 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).


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里的版本号。