简体   繁体   English

CocoaPods 如何安装一个新库而不更新其他库

[英]CocoaPods how to install one new library without update other

I think a question need not be described.我认为一个问题不需要描述。 Usually when I do pod install it updates for me all my libraries.通常当我执行pod install它会为我更新我所有的库。 How can I add one new and just add this new one without update other?如何添加一个新的并且只添加这个新的而不更新其他?

>pod install --no-repo-update

This installs new pods without updating existing pods.这会在不更新现有 Pod 的情况下安装新 Pod。

It's also just faster if you have a many of pods and want a fast install of a new pod.如果您有许多 Pod 并且想要快速安装新的 Pod,它也会更快。

This isn't the expected behavior of pod install .这不是pod install的预期行为。 The only way I can see this happening is if you're not using the Podfile.lock as intended.我能看到这种情况发生的唯一方法是,如果您没有按预期使用Podfile.lock When you specify something in your Podfile that you have never installed before, for example:当您在Podfile中指定以前从未安装过的内容时,例如:

pod 'MyAwesomeLibrary', '~> 1.0.1'

The newest version matching your specification is determined (explained here ) and the resolved version is stored in the Podfile.lock .确定与您的规范匹配的最新版本(在此处解释)并将解析的版本存储在Podfile.lock In this case that could mean that you actually download 1.0.4 etc.在这种情况下,这可能意味着您实际上下载了1.0.4等。

This means when you go to add another library, for example:这意味着当您要添加另一个库时,例如:

pod 'AnotherAwesomeLibrary', '~> 2.0.1'

The same thing will happen for the new one.同样的事情也会发生在新的身上。 But, because of the information previously stored in your Podfile.lock , CocoaPods will just verify that the version specified there is installed.但是,由于之前存储在Podfile.lock中的信息,CocoaPods 只会验证是否安装了指定的版本。 It will not update that library.不会更新那个库。 If you actually want to update it you'll need to run pod update如果你真的想更新它,你需要运行pod update

pod install --no-repo-update

就是这样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM