CocoaPods

作者: younger_times | 来源:发表于2017-02-12 11:12 被阅读16次

    安装

    Mac 自带的ruby ,使用gem命令

    $ sudo gem install cocoapods
    $ pod install
    

    安装的问题:

    1. gem太老

    $ sudo gem update --system
    

    系统升级后,出现 command not found 时,可以运行

    sudo gem install -n /usr/local/bin cocoapods
    

    2. 下载被屏蔽,需要修改源

    gem sources --remove [https://rubygems.org/](https://rubygems.org/)
    gem sources -a [http://ruby.taobao.org/](http://ruby.taobao.org/)
    gem sources -l
    

    修改镜像,提高下载速度

    pod repo remove master
    pod repo add master [http://git](https://gitcafe.com/akuandev/Specs.git).oschinanet/akuandev/Specs.git
    pod repo update
    

    使用

    进入你新创建的项目目录执行命令

    pod init
    

    编辑podfile文件,下载依赖库

    pod 'JSONKit',   '~>1.4'
    

    编辑完成执行

    pod install
    

    更改了podfile需要执行更新

    pod update
    

    查找第三方库

    pod search json
    

    不更新podspec,禁止做索引更新

    pod install --no-repo-update
    pod update --no-repo-update
    

    生成第三方库的帮助文档

    brew install appledoc
    

    相关文章

      网友评论

        本文标题:CocoaPods

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