CocoaPods 安装步骤

iOS开发难免会使用CocoaPods来管理第三方库,那我们今天就来操作一番吧。

一、更换gem源

// 查看现有的源

$ gem source -l

*** CURRENT SOURCES ***

https://gems.ruby-china.com/

**********************************

如果还使用的淘宝的可以删除了 :$ gem sources --remove http://ruby.taobao.org/

现在统一使用-china.com 源,添加命令

$ gem sources --add https://gems.ruby-china.com/

二、更换repo 源

查看当前repo 

$ pod repo list

出现:

trunk

- Type: CDN

- URL:  https://cdn.cocoapods.org/

- Path: /Users/mayizhao/.cocoapods/repos/trunk

我们可以移除它了,命令:

 $ pod repo remove trunk

我们重新添加国内的镜像(我使用的是清华大学开源镜像 https://mirrors.tuna.tsinghua.edu.cn/help/CocoaPods/

$ cd ~/.cocoapods/repos

$ pod repo remove master

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

最后进入自己的工程,在自己工程的podFile第一行加上:

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。