ios 如何检查 CocoaPods 框架的版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18931091/
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
How to check version of a CocoaPods framework
提问by Matrosov Alexander
I have updated Flurry via CocoaPods, but how can I check if Flurry was updated?
我已经通过 CocoaPods 更新了 Flurry,但是如何检查 Flurry 是否已更新?
I mean the terminal shown me that everything is ok:
我的意思是终端告诉我一切正常:
Installing FlurrySDK (4.2.3)
Generating Pods project
Integrating client project
but I am not sure that it has been updated.
但我不确定它是否已更新。
回答by MishieMoo
The Podfile.lock
keeps track of the resolved versions of each Pod installed. If you want to double check that FlurrySDK is using 4.2.3, check that file.
该Podfile.lock
跟踪安装在每个吊舱的解决版本。如果您想仔细检查 FlurrySDK 是否使用 4.2.3,请检查该文件。
Note: You should not edit this file. It is auto-generated when you run pod install
or pod update
注意:您不应编辑此文件。当您运行pod install
或pod update
回答by Nagarjun
To check version of cocoapods from terminal:
从终端检查 cocoapods 的版本:
For Sudoless:
对于 Sudoless:
gem which cocoapods
For Sudo:
对于须藤:
sudo gem which cocoapods
Also note: If you want to edit podfileor podfile.lockdon't edit it in editors. Open only with XCode.
另请注意:如果您想编辑podfile或podfile.lock,请不要在编辑器中进行编辑。仅使用XCode打开。
回答by fede1608
pod outdated
When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock (the versions currently installed for each pod) and that could be updated (as long as it matches the restrictions like pod 'MyPod', '~>x.y' set in your Podfile)
当您运行 pod outdated 时,CocoaPods 将列出所有 Podfile.lock 中列出的具有更新版本的 pod(当前为每个 pod 安装的版本)并且可以更新(只要它符合 pod 'MyPod 之类的限制', '~>xy' 在你的 Podfile 中设置)
回答by Muhammad Aamir Ali
pod --version
pod --version
to get the version of installed pod
获取已安装 pod 的版本
回答by Jayprakash Dubey
You can figure out version of Cocoapods by using below command :
您可以使用以下命令找出 Cocoapods 的版本:
pod —-version
o/p :1.2.1
o/p :1.2.1
Now if you want detailed version of Gems and Cocoapodsthen use below command :
现在,如果您想要Gems 和 Cocoapods 的详细版本,请使用以下命令:
gem which cocoapods
(without sudo)
gem which cocoapods
(没有sudo)
o/p :/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb
o/p :/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb
sudo gem which cocoapods
(with sudo)
sudo gem which cocoapods
(使用须藤)
o/p :/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb
o/p :/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods.rb
Now if you want to get specific version of Pod present in Podfilethen simply use command pod install
in terminal. This will show list of pod being used in project along with version.
现在,如果您想在 Podfile 中获取特定版本的 Pod,那么只需pod install
在终端中使用命令即可。这将显示项目中正在使用的 pod 列表以及版本。
回答by Felix Seele
I wrote a small commandline tool that parses the Podfile.lock and shows which version of each Pod is currently installed. It will also check for the latest version online and give you a summary of dependencies which are out-of-date.
我写了一个小的命令行工具来解析 Podfile.lock 并显示当前安装的每个 Pod 的版本。它还将在线检查最新版本,并为您提供过时的依赖项摘要。
You can find it on Github: https://github.com/citruz/podchecker
你可以在 Github 上找到它:https: //github.com/citruz/podchecker
回答by yoAlex5
Cocoapods version
可可豆版本
CocoaPods
[About]program that is built with Ruby and it will be installable with the default Ruby available on macOS.
CocoaPods
[关于]使用 Ruby 构建的程序,可以使用 macOS 上可用的默认 Ruby 进行安装。
pod --version //1.8.0.beta.2
//or
gem which cocoapods //Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.0.beta.2/lib/cocoapods.rb
A pod version
一个豆荚版本
Version of pods that is specified in Podfile
中指定的 pod 版本 Podfile
Podfile.lock
Podfile.lock
It is located in the same folder as Podfile
. Here you can find a version of a pod which is used
它位于与Podfile
. 在这里您可以找到使用的 pod 版本
Search for pods
搜索豆荚
If you are interested in allavailable version of specific pod you can use
如果您对特定 pod 的所有可用版本感兴趣,可以使用
pod search <pod_name>
//or
pod trunk info <pod_name>
回答by Lance Samaria
The highest voted answer (MishieMoo) is correct but it doesn't explain how to open Podfile.lock. Everytime I tried I kept getting:
投票最高的答案 (MishieMoo) 是正确的,但它没有解释如何打开 Podfile.lock。每次我尝试时,我都不断得到:
You open it in terminal by going to the folder it's in and running:
您可以通过转到它所在的文件夹并运行来在终端中打开它:
vim Podfile.lock
I got the answer from here: how to open Podfile.lock
我从这里得到了答案:如何打开 Podfile.lock
You close it by pressing the colon and typing quit then enter
您可以通过按冒号并输入quit然后输入来关闭它
:quit //then return key
回答by Naishta
Podfile.lockfile right under Podfile within your project.
Podfile.lock文件就在您项目中的Podfile下。
The main thing is , Force it to openthrough your favourite TextEditor, like Sublime or TextEdit [Open With -> Select Sublime] as it doesn't give an option straight away to open.
最重要的是,强制它通过您最喜欢的 TextEditor打开,例如 Sublime 或 TextEdit [打开方式 -> 选择 Sublime],因为它不会立即提供打开选项。
回答by K.Gowri Manohari
pod --versionused this to check the version of the last installed pod
pod --version使用它来检查最后安装的 pod 的版本