<<史上最简洁版本>>

1.gem sources -l查看 当前的源

//1.1 sudo -i、、以下都是以管理员的身份来操作的

2.gem sources --remove https://rubygems.org/

3.gem sources -a https://ruby.taobao.org/

4.xcode-select --install

5.gem install cocoapods

6.pod repo remove master

7.pod repo add master https://gitcafe.com/akuandev/Specs.git

8.pod repo update

9.pod search AFNetworking

10.cd XXX

11.pod install

或者

开源库的使用

1.CocoaPods的安装及使用

2.利用开源库Diplomat实现分享及第三方登录

3.git的使用

1.CocoaPods的安装及使用:
http://code4app.com/article/cocoapods-install-usage
http://objccn.io/issue-6-4/
http://www.jianshu.com/p/5fc15906c53a

查看当前的源
1.gem sources -l

2.gem sources --remove https://rubygems.org/

//等有反应之后再敲入以下命令,添加淘宝镜像

3.gem sources --add https://ruby.taobao.org/

只有在终端中出现下面文字才表明你上面的命令是成功的:
*** CURRENT SOURCES ***
https://ruby.taobao.org/

这时候,你再次在终端中运行:
--verbose参数表示显示指令的执行过程
4.sudo gem install cocoapods --verbose

//将 CocoaPods Specs repository复制到你电脑上~/.cocoapods目录下,
它需要一点时间来完成,你等就是了
5.pod setup --verbose

6.pod repo remove master

7.pod repo add master https://gitcafe.com/akuandev/Specs.git

如果安装失败 ~/.cocoapods 里面是空的,就需要重新setup
命令如下:
pod repo remove master
pod setup

执行pod setup如果出现如下报错
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --depth=1

xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

则执行:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

如果Ruby环境不够新,可能需要更新以下:
sudo gem update --system

查看版本:
8.pod --version

搜索:
9.pod search AFNetworking

生成Podfile文件
10.pod init

11.Podfile文件示例:

platform :ios, '6.0'

target 'iOSDevTemplate' do
pod 'AFNetworking' //不显式指定依赖库版本,表示每次都获取最新版本
pod 'AFNetworking', ‘2.0’ //只使用2.0版本
pod 'AFNetworking', ‘>2.0′ //使用高于2.0的版本
pod 'AFNetworking', ‘>=2.0′ //使用大于或等于2.0的版本
pod 'AFNetworking', ‘<2.0′ //使用小于2.0的版本
pod 'AFNetworking', ‘<=2.0′ //使用小于或等于2.0的版本
pod 'AFNetworking', ‘~>0.1.2′ //使用大于等于0.1.2但小于0.2的版本,相当于>=0.1.2并且<0.2.0
pod ‘AFNetworking’, ‘~>0.1′ //使用大于等于0.1但小于1.0的版本
pod ‘AFNetworking’, ‘~>0′ //高于0的版本,写这个限制和什么都不写是一个效果,都表示使用最新版本

end

12.下载开源库:<今后经常使用的>//当你每次需要加入第三方库的时候。。。
pod install --no-repo-update --verbose

13.更新开源库:
pod update --no-repo-update --verbose

14.更新本地索引库
pod repo update --verbose

15.注意:##使用pod管理的第三方库,导入头文件时,需要使用尖括号<>,,如:#import <UMSocial.h>,,,如果不采用pod管理第三方库的话,#import "UMSocial.h"##

2.利用开源库Diplomat实现分享及第三方登录:

微信,微博,QQ,支付宝等通过下面唯一标识跳回本应用
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wb1815822993</string>
<string>wxd930ea5d5a258f4f</string>
<string>tencent1102909370</string>
</array>
</dict>
</array>

//iOS9.0新增,允许不安全的网络传输
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

//iOS9.0新增,URL Scheme 白名单
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wechat</string>
<string>weixin</string>
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqzoneopensdk</string>
</array>

百度地图URL Scheme:baidumap
高德地图: iosamap

<!-- 支付宝 URL Scheme 白名单-->
<string>alipay</string>
<string>alipayshare</string>

分享Demo:https://github.com/sinofake/ShareDemo
Diplomat地址: https://github.com/lingochamp/Diplomat

开源中国:http://git.oschina.net/oschina/iphone-app
https://github.com/thoughtbot/Tropos
https://github.com/itjhDev/itjh
https://github.com/ltebean/novel-design
https://github.com/coderyi/Monkey
土豆:https://github.com/lookingstars/tudou
美团:https://github.com/lookingstars/meituan
糯米:https://github.com/RyanTech/nuomi
https://github.com/lookingstars/chuanke
网易框架:https://github.com/dsxNiubility/SXNews
https://github.com/12207480/KnowingLife
https://github.com/Coding/Coding-iOS
https://github.com/haolloyin/MrCode

生成pub文件
ssh-keygen -t rsa -C "cuirong.zhu@corp.elong.com"

10.11版本及以上
command+r 开机进入恢复模式
csrutil disable
http://www.jianshu.com/p/23c01067cf7e

更新升级10.11 cocoapods安装出问题最简单的解决方法
这是因为10.11把cocoapods直接干掉了
sudo gem install -n /usr/local/bin cocoapods
再加一句,完美解决
sudo xcode-select --switch /Applications/Xcode.app

CocoaPods的安装及使用/利用开源库Diplomat实现分享及第三方登录/git的使用的更多相关文章

  1. 第一百四十三节,JavaScript,利用封装库做百度分享

    JavaScript,利用封装库做百度分享 效果图 html代码 <div id="share"> <h2>分享到</h2> <ul> ...

  2. linux下安装libcurl及开源库的一般安装步骤

    前言 总有人说:要多看源代码!那么源代码去哪找呢?找到了又该怎么安装呢?本票博客不介绍如何使用和学习,只要讲获取和安装,以后会将curl和libevent的使用和学习. 一.开源库常用安装步骤 1.开 ...

  3. 使用开源库 MBProgressHUD 等待指示器

    source https://github.com/jdg/MBProgressHUD MBProgressHUD is an iOS drop-in class that displays a tr ...

  4. CocoaPods:管理Objective-c 程序中各种第三方开源库关联

    在我们的iOS程序中,经常会用到多个第三方的开源库,通常做法是去下载最新版本的开源库,然后拖拽到工程中. 但是,第三方开源库的数量一旦比较多,版本的管理就非常的麻烦.有没有什么办法可以简化对第三方库的 ...

  5. (转)CocoaPods:管理Objective-c 程序中各种第三方开源库关联

    在我们的iOS程序中,经常会用到多个第三方的开源库,通常做法是去下载最新版本的开源库,然后拖拽到工程中. 但是,第三方开源库的数量一旦比较多,版本的管理就非常的麻烦.有没有什么办法可以简化对第三方库的 ...

  6. 如何使用CocoaPods安装使用及配置私有库以及管理依赖库 【原创】

    CocoaPods是什么 在iOS开发中势必会用到一些第三方依赖库,比如大家都熟悉的ASIHttpRequest.AFNetworking.JSONKit等.使用这些第三方类库能极大的方便项目的开发, ...

  7. libCURL开源库在VS2010环境下编译安装,配置详解

    libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 http://blog.csdn.net/su ...

  8. MXNet 学习 (1) --- 最易上手的深度学习开源库 --- 安装及环境搭建

    安装环境:Win 10 专业版 64位 + Visual Studio 2015 Community. 记录下自己在有GPU的环境下安装配置MXNet的过程.该过程直接使用MXNet release ...

  9. DCMTK开源库的学习笔记4:利用ini配置文件对dcm影像进行归档

    转:http://blog.csdn.net/zssureqh/article/details/8846337 背景介绍: 医学影像PACS工作站的服务端需要对大量的dcm文件进行归档,写入数据库处理 ...

随机推荐

  1. BZOJ1508 : [NOI2003]Game

    a[i][j]:i移动一根变成j是否可能 b[i][j]:i增加一根变成j是否可能 枚举在一个数字中移动的情况以及在两个数字中移动的情况 #include<cstdio> #include ...

  2. NSMutableArray 存放BOOL

    注意BOOL是不能直接存放在NSMutableArray中的 NSNumber* yesObj = [NSNumber numberWithBool:YES]; NSMutableArray* arr ...

  3. Google Code Jam 2010 Round 1B Problem B. Picking Up Chicks

    https://code.google.com/codejam/contest/635101/dashboard#s=p1   Problem A flock of chickens are runn ...

  4. C++ Ouput Exactly 2 Digits After Decimal Point 小数点后保留三位数字

    在C++编程中,有时候要求我们把数据保留小数点后几位,或是保留多少位有效数字等等,那么就要用到setiosflags和setprecision函数,记得要包含头文件#include <ioman ...

  5. github配置

    注册github账号: 准备秘钥文件: 认证: https://github.com 测试秘钥: 创建仓库: 执行下面命令创建git远程仓库: 添加一个two.txt文件:

  6. 利用onekeyup即可实现验证码的点击刷新功能

    显示验证码 首先在Home/Controller下创建一个公共控制器PublicController 1 <php2 namespace Home\Controller;3 4 use Thin ...

  7. CruiseControl.Net学习记录

    一.下载 官网 二.安装 本文版本:1.8.5.0 运行安装程序,按照提示"下一步”,直到完成即可. 安装完毕之后, 生成一个windows服务,CruiseControl.NET Serv ...

  8. PHP 设计模式 笔记与总结(4)PHP 链式操作的实现

    PHP 链式操作的实现 $db->where()->limit()->order(); 在 Common 下创建 Database.php. 链式操作最核心的地方在于:在方法的最后 ...

  9. 那么都数据库表,那么多不同记录。是怎样都存储在一个key-value数据库的?

    那么都数据库表,那么多不同记录.是怎样都存储在一个key-value数据库的? :设置不同的键值而已!不同的表,选出统一的key规范 jedis.sadd("tom:friend:list& ...

  10. IDM 通过防火墙规则阻止激活验证

    1. 打开Windows防火墙 2. 高级设置-->出站规则-->新建规则 3. 添加IDM程序路径,阻止连接 4. 在属性中添加作用域,远程IP地址: DNS解析出IP:register ...