Writing in the front
If you’re a multi-developer, you’ve probably had a bit of a problem with your podfile. lock file. If you’re a solo developer you don’t have the problem of saying you have a podfile. lock file.
The podfile. lock file
Note the version numbers of all third-party frameworks when you last updated Pods. The podfile. lock file mainly contains: PODS, DEPENDENCIES, SPEC REPOS, SPEC CHECKSUMS, and PODFILE CHECKSUM record the version number of each pod, the CHECKSUM (SHA1) of the podspec.json file that is dependent on other libraries. This information ensures that when multiple people collaborate, everyone is using the same version of the third-party library.
Two. Pod common instruction difference
pod install
- if
Podfile.lock
File does not exist, will be based onPodfile
Files are installed by third-party frameworks and generatedPodfile.lock
file - if
Podfile.lock
The file exists and will be based onPodfile.lock
The version number of the file to install the third-party framework
pod update
- According to the
Podfile
Files to install third-party frameworks - Will all third party frameworks
Update to the latest version
And create onePodfile.lock
fileOverwrites the original podfile. lock file
pod install/update –no-repo-update
Does not run until the framework is installedpod repo update
, meaning to use the locally cached framework version without checking the server version
Pod Install/POD Update Process description
- Through the
pod install
orpod update
Instructions are executed before the framework is installedpod repo update
Whether the latest version of the framework is installed in the project depends on the installation method:pod install
(Specify the version) andpod update
(Latest version) - In the first execution
pod install
Instruction,podfile.lock
It doesn’t exist yet. It’s based onpodfile
To integrate the framework. If the framework version number is specified, the specified version is installed; if not, the latest version is installed and automatically generatedpodfile.lock
file - Execute again later
pod install
Instructions will be based onpodfile.lock
To install the framework. - Even if the server has the latest version, pass
pod install
The directive also does not install the latest third party frameworks, only according topodfile.lock
In the recorded version to install
Application in projects
Podfile.lock
Version control should be added to ensure that the partners of the dependent library version is consistent, to prevent difficult to findbug
In addition, version control should be added at the time of initial project creation.Podfile
Syntax should be as strict as possible, and it is best to specify explicit dependency library versions.- understand
pod install
和pod update
And the difference between themPodfile.lock
The impact of fair use. It’s usually multi-purposepod install
, when neededpod update
.
Write in the back
Podfile is more like a version constraint, whereas podfile. lock is the version you actually use. If you are asked to determine which version of a tripartite library your app uses, you should not look for Podfile, but rather the file podfile. lock.
Finally learn harmoniously, not impatient. I’m still me, a different color of fireworks.