首页 > 其他 > 详细

cocoapods安装配置及使用

时间:2021-01-03 21:44:14      阅读:30      评论:0      收藏:0      [点我收藏+]

环境:

  Ruby版本:ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

  cocoapods版本:1.10.0

 

1.切换Ruby镜像源

gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/
#验证
gem sources -l

2.安装cocoapods

sudo gem install cocoapods

3.指定cocoapods镜像源

pod remove master
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master

4.配置podfile

#1.在项目所在目录创建podfile文件
#2.指定pod repo update时cocoapods镜像源
#3.指定工作空间所在目录
#4.target do end指定第三方库依赖的目标项目

source https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
workspace /Users/breeze/Desktop/DemoApp/DemoApp.xcodeproj
target    DemoApp do

platform :ios, 14.3
pod AFNetworking, ~> 4.0.1

end

5.导入第三方库

pod install

cocoapods安装配置及使用

原文:https://www.cnblogs.com/yangshaox/p/14226129.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!