美文网首页程序员转发收藏
podfile.lock文件是什么鬼👻

podfile.lock文件是什么鬼👻

作者: 书写不简单 | 来源:发表于2018-10-30 11:28 被阅读2次

我们在托管第三方的时候都是用到 podfile 文件,在项目启动以后也会生成一份 podfile.lock 文件。本篇文章说一下这个 podfile 文件的生成时机,工程什么时候使用,以及项目启动过程中遇到的一些 bug (关于podfile的bug)。

这里提一下 podfile 文件,该文件里面记录的是我们项目中用到的第三方
podfile.lock 文件是记录使用的第三方的版本号(只记录最后一次更新)

那这个文件在什么使用会生成 ? 什么时候又会被用到 ? 这两个问题要从我们常用的 pod 指令说起,常用的指令有 $ pod install$ pod update

终端里面输入 --help 指令 大致了解一下 这两个指令 :

help.png
除了上面的两个指令以外还有一个中间的指令 repo ,在通过 pod installpod update 指令安装框架前,都会先执行 pod repo update 指令,将服务器最新的框架下载到本地,项目中是否安装最新版本的框架,取决于安装方式: pod install(指定版本)pod update(最新版本)
  • $ pod install

    • 如果 podfile.lock 文件不存在,会根据 podfile 文件安装第三方框架,并生成 podfile.lock 文件
    • 如果 podfile.lock 文件存在,会根据 podfile.lock 文件的版本号来安装第三方框架,即便服务器中有最新的版本,通过 pod install 指令也不会安装最新的第三方框架,只会根据 podfile.lock 中记录的版本来安装
  • $ pod update

    • 根据 podfile 文件安装第三方框架,将所有第三方框架更新到最新版本,并且创建一个 podfile.lock 文件覆盖掉原文件
  • $ pod install/update --no-repo-update

    • 安装框架前不会执行 pod repo update ,意味着不去检查服务器版本,直接使用本地缓存的框架版本

相关文章

  • podfile.lock文件是什么鬼👻

    我们在托管第三方的时候都是用到 podfile 文件,在项目启动以后也会生成一份 podfile.lock 文件。...

  • pod安装

    pod update 会更新Podfile.lock文件pod install 不会更新Podfile.lock文...

  • (四)Podfile vs. Podfile.lock

    下面是 Podfile 与 Podfile.lock 两个文件的对比: Podfile: Podfile.lock:

  • pod update 和pod install 区别

    Podfile.lock 是在第一次运行 pod install 时生成的 Podfile.lock这个文件是用来...

  • CocoaPods

    1、 不要删除 Podfile.lock,并且必须签入到 VCS 中。不能把Podfile.lock文件加入到.g...

  • 常用pod命令

    pod init: 创建Podfile文件 pod install:会根据podfile.lock文件中指定的po...

  • pod 命令

    pod init: 创建Podfile文件 pod install:会根据podfile.lock文件中指定的po...

  • IOS cocoapods 常用命令

    常用命令 pod init: 创建Podfile文件 pod install:会根据podfile.lock文件中...

  • 20170414-ld: framework not found

    个人解决方法,1、将工程目录下的文件:工程名.xcworkspace 文件、Podfile.lock文件、Pod...

  • CocoaPods卸载

    删除工程文件夹中的Podfile、Podfile.lock还有Pods文件夹 删除xcworkspace文件3F8...

网友评论

    本文标题:podfile.lock文件是什么鬼👻

    本文链接:https://www.haomeiwen.com/subject/somwtqtx.html