【问题标题】:how to install speacific podfile in ios with out touching other podfiles如何在不接触其他 podfile 的情况下在 ios 中安装特定的 podfile
【发布时间】:2015-12-25 08:26:25
【问题描述】:

我想使用 cocoapods 安装特定的依赖项。如果我执行 pod install,其他依赖项会在安装我新添加的依赖项之前更新。我只想安装特定的 pod 而不会触及其他依赖项。而且我知道删除、更新任何依赖项也会更新其他依赖项。有什么办法可以解决这个问题吗?

实际上我的问题是当我自己修改一些依赖项并运行 pod install 时,它会恢复到原来的版本。但我不想丢失我的更改

任何建议将不胜感激。

【问题讨论】:

    标签: ios xcode cocoapods


    【解决方案1】:

    确保 Podfile.lockPodfile 位于同一文件夹中。

    Podfile

    中添加一行
    pod 'MBProgressHUD','~> 0.9'
    

    cd 到您的项目并在终端中使用以下行,它将安装您指定的上述 pod。

    pod install podName
    

    来自官网the link

    运行 pod install 将安装当前版本的 RestKit,导致生成一个 Podfile.lock 指示安装的确切版本(例如 RestKit 0.10.3)。多亏了 Podfile.lock,即使有更新的版本可用,稍后在另一台机器上运行这个假设项目的 pod install 仍然会安装 RestKit 0.10.3。 CocoaPods 将尊重 Podfile.lock 中的 Pod 版本,除非在 Podfile 中更新了依赖项或调用了 pod update(这将导致生成新的 Podfile.lock)。通过这种方式,CocoaPods 避免了因依赖项意外更改而引起的头痛。

    【讨论】:

      猜你喜欢
      • 2015-12-22
      • 2017-03-05
      • 2015-08-03
      • 2020-12-12
      • 1970-01-01
      • 1970-01-01
      • 2018-07-23
      • 1970-01-01
      • 2023-01-19
      相关资源
      最近更新 更多