美文网首页IOS 学习
CocoaPods 安装步骤

CocoaPods 安装步骤

作者: 这是一个谜 | 来源:发表于2020-05-15 15:26 被阅读0次

    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'

    相关文章

      网友评论

        本文标题:CocoaPods 安装步骤

        本文链接:https://www.haomeiwen.com/subject/tmycohtx.html