`pod repo update` 究竟做了什么?
What exactly does `pod repo update` do?
我正在学习有关 Firebase 的互联网教程,作为其中的一部分,我必须在命令行上做一些工作。我对命令行很满意,但对 Cocoapods 不熟悉。我 运行 pod repo update
但在这样做之后我意识到我 运行 它在我 Mac 的整个文档文件夹而不是包含我的项目的文件夹中。我花了 20 多分钟来执行,当它最终完成时它打印出了成千上万的东西,其中一些包括“创建”和“删除”。我有点担心 - 运行 这个命令会修改我的文档中除了 Firebase 项目之外的任何内容吗? pod repo update
甚至为此做了什么?
根据文档 pod repo update 更新位于您的主文件夹中 ~/.cocoapods/repos
的规范存储库。
Updates the local clone of the spec-repo NAME. If NAME is omitted this
will update all spec-repos in ~/.cocoapods/repos.
repo
基本上是所有 pods 和可用版本的列表。我刚刚在我们的 CI 构建中遇到了一个错误,因为 repo 没有包含我刚刚添加的库的规范。通过 运行 pod repo update
它现在知道这个较新的版本并且可以继续安装它。
所以回答你的问题.. 运行 pod repo update
在你的文档文件夹中不会在该文件夹中执行任何操作。它将仅在您的 ~/.cocoapods/repos
文件夹中更新其 pod 规范引用。
主要的 Specs 存储库只不过是所有 PodSpec 的列表。一个 PodSpec 是:
A specification describes a version of Pod library. It includes details about where the source should be fetched from [which tag or commit or branch], what files to use, the build settings to apply, and other general metadata such as its name, version, and description.
specs 目录只不过是所有不同 PodSpec 的列表。 PodSpec 的每个版本都在一个标签目录下。 repo 不包含 pod 本身。回购包含 PodSpec。 PodSpec 给出了 repo 的位置和一堆其他元数据⚡︎
spec.source = { :git => 'https://github.com/tonymillion/Reachability.git', :tag => 'v3.1.0' }
当您执行 pod repo update
时,您正在从 https://github.com/CocoaPods/Specs 中提取最新的 PodSpec(不是实际的 pod)。如果您只想更新单个 pod 源,则只需执行 pod repo update [NAME]
Cocoapods/Specs 主仓库:
list of some Alamofire PodSpecs
A single PodSpec 4.7.3:
⚡︎: PodSpec: A specification describes a version of Pod library. It
includes details about where the source should be fetched from, what
files to use, the build settings to apply, and other general metadata
such as its name, version, and description.
您的实际项目通过 pod update
或 pod install
引入代码,然后将物理文件下载到您的 mac 并复制到您的项目中。
我正在学习有关 Firebase 的互联网教程,作为其中的一部分,我必须在命令行上做一些工作。我对命令行很满意,但对 Cocoapods 不熟悉。我 运行 pod repo update
但在这样做之后我意识到我 运行 它在我 Mac 的整个文档文件夹而不是包含我的项目的文件夹中。我花了 20 多分钟来执行,当它最终完成时它打印出了成千上万的东西,其中一些包括“创建”和“删除”。我有点担心 - 运行 这个命令会修改我的文档中除了 Firebase 项目之外的任何内容吗? pod repo update
甚至为此做了什么?
根据文档 pod repo update 更新位于您的主文件夹中 ~/.cocoapods/repos
的规范存储库。
Updates the local clone of the spec-repo NAME. If NAME is omitted this will update all spec-repos in ~/.cocoapods/repos.
repo
基本上是所有 pods 和可用版本的列表。我刚刚在我们的 CI 构建中遇到了一个错误,因为 repo 没有包含我刚刚添加的库的规范。通过 运行 pod repo update
它现在知道这个较新的版本并且可以继续安装它。
所以回答你的问题.. 运行 pod repo update
在你的文档文件夹中不会在该文件夹中执行任何操作。它将仅在您的 ~/.cocoapods/repos
文件夹中更新其 pod 规范引用。
主要的 Specs 存储库只不过是所有 PodSpec 的列表。一个 PodSpec 是:
A specification describes a version of Pod library. It includes details about where the source should be fetched from [which tag or commit or branch], what files to use, the build settings to apply, and other general metadata such as its name, version, and description.
specs 目录只不过是所有不同 PodSpec 的列表。 PodSpec 的每个版本都在一个标签目录下。 repo 不包含 pod 本身。回购包含 PodSpec。 PodSpec 给出了 repo 的位置和一堆其他元数据⚡︎
spec.source = { :git => 'https://github.com/tonymillion/Reachability.git', :tag => 'v3.1.0' }
当您执行 pod repo update
时,您正在从 https://github.com/CocoaPods/Specs 中提取最新的 PodSpec(不是实际的 pod)。如果您只想更新单个 pod 源,则只需执行 pod repo update [NAME]
Cocoapods/Specs 主仓库:
list of some Alamofire PodSpecs
A single PodSpec 4.7.3:
⚡︎: PodSpec: A specification describes a version of Pod library. It includes details about where the source should be fetched from, what files to use, the build settings to apply, and other general metadata such as its name, version, and description.
您的实际项目通过 pod update
或 pod install
引入代码,然后将物理文件下载到您的 mac 并复制到您的项目中。