pod install 和 pod update的區別


pod install 和 pod update的區別
pod install(下載並安裝pod)
1,當pod file文件中有“增加pod,刪除pod,修改pod”的操作之后使用。
2,pod install執行完之后會將已下載的依賴庫的版本號添加進podfile.lock文件
3,pod install根據podfile.lock文件列出的已安裝的pod的版本信息,只負責下載安裝 podfile.lock中不存在的pod ,不會自動更新已安裝的pod的版本。
 
pod update (更新已存在的pod)
按規則將podfile文件中的pod更新到最新版本。並將pod版本信息寫入 podfile.lock
 

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.

  • 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 andlocks those versions.
  • When you run pod install, it only resolve dependencies for pods that are not already listed in thePodfile.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')

pod outdated

When you run pod outdated, CocoaPods will list all pods which have newer versions than the ones listed in thePodfile.lock (the versions currently installed for each pod). This means that if you run pod update PODNAME on those pods, they will be updated — as long as the new version still matches the restrictions likepod 'MyPod', '~>x.y' set in your Podfile.

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

If you run pod update with no pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM