CocoaPods podfile 文件配置

记录一下关于 CocoaPods podfile 文件配置

  • 指定源(Source)
    默认情况下,在全局级别指定的源将按照依赖项匹配指定的顺序进行搜索。
    对于特定的依赖,可以单独指定依赖源:
bash 复制代码
pod 'PonyDebugger', :source => 'https://github.com/CocoaPods/Specs.git'
  • 使用字库(Subspecs)
    当通过Pod的名称安装Pod时,它将安装podspec文件中定义的所有默认subspecs
    可以使用下面的方式导入特定的subspec
bash 复制代码
pod 'QueryKit/Attribute'

or

pod 'QueryKit', :subspecs => ['Attribute', 'QuerySet']
  • 使用本地私有库(自己创建的本地库)
bash 复制代码
pod 'AFNetworking', :path => '~/Documents/AFNetworking'

注意,本地私有库中的,podspec文件必须在该文件夹中。

  • 制定分支或者commit

指定源,默认是master分支

bash 复制代码
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git'

指定其他分支

bash 复制代码
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :branch => 'dev'

使用tag

bash 复制代码
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0'

特殊的commit

bash 复制代码
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f8319af'

podspec文件应该位于存储库的cocopods 存放的根目录中,如果这个库的存储库中还没有podspec文件,可以从其它来源获得:

bash 复制代码
pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
相关推荐
黄毛火烧雪下3 天前
ruby 、gem 和 cocoapods的联系与区别
开发语言·ruby·cocoapods
咸鱼一号4 天前
记录我适配iOS26遇到的一些问题
xcode
QuantumLeap丶5 天前
《Flutter全栈开发实战指南:从零到高级》- 04 - Widget核心概念与生命周期
flutter·xcode
大熊猫侯佩7 天前
思过崖上学「 subprocess 」:令狐冲的 Swift 6.2 跨平台进程心法
spm·xcode·进程控制·platform·subprocess·output·swift 6.2
__基本操作__7 天前
西电25年A测 语音识别机械臂方案与教程
语音识别·机械臂·xcode·西电a测
疯笔码良9 天前
【Flutter】flutter安装并在Xcode上应用
flutter·macos·xcode
lichong95110 天前
【Xcode】Macos p12 证书过期时间查看
前端·ide·macos·证书·xcode·大前端·大前端++
_阿南_10 天前
flutter在Xcode26打包的iOS26上全屏支持右滑的问题
flutter·ios·xcode
驰羽12 天前
[GO]Go语言泛型详解
开发语言·golang·xcode
小瓶盖_tl14 天前
在Mac上安装CocoaPods问题处理
macos·xcode·cocoapods