ios 如何在不接触其他依赖项的情况下安装特定的 pod

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30372294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 06:02:34  来源:igfitidea点击:

How to install specific pod without touching other dependencies

iosobjective-ccocoapods

提问by Shamsiddin

I want to install specific dependency using cocoapods. if I execute pod install, other dependencies are getting updated before installing my newly added dependency. I just want to install specific pod without touching any others. And I know deleting, updatingany dependency also updates others. Is there any way to solve this problem?

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

Actually my problem is when I myself modify some dependency (AFNetworkingfor example) and run pod installit reverts back to its original version. But I don't want to lose my changes.

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

回答by Imran

To Skip running pod repo update before install.Use

在安装之前跳过运行 pod repo 更新。使用

pod install --no-repo-update

回答by atulkhatri

To install a plugin without updating existing ones-> Add that plugin in your Podfile and use:

要在不更新现有插件的情况下安装插件 -> 在 Podfile 中添加该插件并使用:

pod install --no-repo-update

pod install --no-repo-update

To remove/update a specific plugin use:

要删除/更新特定插件,请使用:

pod update POD_NAME

pod update POD_NAME

Tested!

测试!

回答by Hardik Bar

1) If you want to update single pod

1) 如果你想更新单个 pod

pod update 'yourpodname'

豆荚更新“你的豆荚名”

2) if you want to install one pod without affecting another pod

2)如果你想安装一个pod而不影响另一个pod

pod install --no-repo-update

pod install --no-repo-update

3)if you want to install/update specific version of pod

3)如果你想安装/更新特定版本的pod

pod 'Stripe', '3.0'

豆荚“条纹”,“3.0”

4) if you want to install/update latest version of pod than

4)如果你想安装/更新最新版本的pod

pod 'KCFloatingActionButton'

pod 'KCFloatingActionButton'

回答by Jatin Patel - JP

Here you can skip integration of the Pods libraries in the Xcode project(s) by using following command.

在这里,您可以使用以下命令跳过 Xcode 项目中 Pods 库的集成。

pod install --no-integrate

Pod install

Pod 安装

Hope this help you.

希望这对你有帮助。

回答by Matt

At the time of writing, pod install will only install pods in the PodFile that haven't already been installed. The others will not be updated. This issue appears to have been solved by the CocoaPods project.

在撰写本文时, pod install 只会安装 PodFile 中尚未安装的 pod。其他的就不更新了。这个问题似乎已经被 CocoaPods 项目解决了。

回答by aqsa arshad

Here is another way of doing it. If you want to install newly added pod and don't want to update other dependancies you need to remove "~>" from all your pods you don't want to update. For example in case of AFNetworking

这是另一种方法。如果您想安装新添加的 pod 并且不想更新其他依赖项,您需要从您不想更新的所有 pod 中删除“ ~>”。例如在 AFNetworking 的情况下

pod 'AFNetworking', '2.2.1'   instead of pod 'AFNetworking',~> '2.2.1' 

回答by renodoo

If you have your first "Podfile.lock" in your project folder, you just have to use

如果您的项目文件夹中有第一个“Podfile.lock”,则只需使用

pod install

Your "Podfile.lock" has registered the version of your old pod so you don't need to do something else

您的“Podfile.lock”已注册旧 Pod 的版本,因此您无需执行其他操作

回答by Vinayak Pal

Do not get confused just open up the existing file and added the numbers of pod file below the existing pods.

不要混淆,只需打开现有文件并在现有 pod 下方添加 pod 文件的编号即可。

Further, go to terminal and open up your project and run command:

此外,转到终端并打开您的项目并运行命令:

$ pod install

$ pod安装

(This command will only add on the new pod without disturbing your existing pods)

(此命令只会添加新的 Pod,而不会干扰您现有的 Pod)

回答by Nathan Hegedus

pod repo update && pod update 'YOURPOD'