The difference between pod update and pod install

Time:2022-5-24

Pod update updates the local specs repository
Pod install is based on the three-party libraries in the local specs pod
As shown below

The difference between pod update and pod install

Screenshot: 4.25.05 PM, December 20, 2021 png

If the third-party library in the podfile file does not specify a version number
1. Using pod install will the latest local version of pod
2. Using pod update will update the local repository first and then download the latest version
As shown below

The difference between pod update and pod install

A190334CB56F8BF58A705C7A55D43AAA.png

Pod install will be based on podfile Use the information in lock to install the third-party library

Pod update will update the warehouse and recreate a podfile Lock and then install the third-party library

What’s the impact of saying so much?

1. If developed independently, the two have no impact

2. If multiple people develop and their respective versions of cocoapods are different
There is no problem using pod install
Using pod update may cause the code you upload to fail to run when others down, and the code you upload to fail to run when others down

So be careful when using pod update

be careful ⚠️:
Another note is that when uploading code, you must pay attention to putting podfile Lock is also uploaded. Otherwise, a new podfile will be generated after someone else downloads pod install lock
Then the above problems appear

Upload podfile The purpose of lock is for others to use the three-party library installed by pod to keep consistent with yours

Podfile. The information in lock is shown in the figure. It shows the information of your third-party database and cocoapods

The difference between pod update and pod install

0118D0B19B0BAA94B53C1E7870B517FC.png