使用正确的版本自动安装 CocoaPods

Automate CocoaPods installation with the right version

我开始处理一个现有项目,它使用 Cocoapods 作为依赖管理器,这是我第一次使用它。安装好后,我运行 pod init然后手工一个一个添加依赖,然后用pod install安装。

现在我遇到依赖版本问题,无法更改项目版本。有没有办法可以找出项目的依赖项版本?有没有办法让我可以自动安装 CocoaPods,这样我就不需要一个一个地写它们了?

没有 Pod 文件并且 pod.framework 文件是红色和 t运行sparent。

在您的框架存储库中,查看哪些版本与您正在使用的版本兼容。然后,在您的 Podfile 中实现这样的框架:

pod 'AFNetworking', '1.2.0'

http://cocoapods.org

检查 'Get started'

如果您使用的是旧版本的 swift,可能是您正在使用的框架使用了最新版本的 swift,这就是它无法正常工作的原因。

不一一安装的提示:

pod instal               // will install all dependencies 
pod instal --repo-update // will install only the ones that needs to update
pod update               // will install and update everything

客户端忘记将 Podfile 推送到存储库。我要了 Podfile。将文件放入我的项目目录后,我可以在我的终端中 运行 pod install 之后构建应用程序。对于初学者,我建议不要将 Podfile 放在你的 .gitignore 文件中。