<<史上最简洁版本>>

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. HDU 2653 (记忆化BFS搜索+优先队列)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2653 题目大意:迷宫中有普通点和陷阱.其中普通点可以走可以飞,但是陷阱只能飞.走耗时1,飞耗时2.但 ...

  2. TYVJ P1086 Elevator Label:dp

    背景 广东汕头聿怀初中 Train#2 Problem4 描述 现有N种箱子,每种箱子高度H_i,数量C_i.现选取若干箱子堆成一列,且第i种箱子不能放在高度超过A_i的地方.试求最大叠放高度. 输入 ...

  3. ITK 3.20.1 VS2010 Configuration 配置

    Download ITK 3.20.1 Download VS2010 Download CMake 3.2.0 I assume you've already installed VS2010 an ...

  4. Qt Examples Qt实例汇总

    ActiveQt Examples Using ActiveX from Qt applications. Animation Framework Examples Doing animations ...

  5. Ubuntu SSH root user cannot login

    Open /etc/ssh/sshd_config and check if PermitRootLogin is set to yes. If not, then set it to yes and ...

  6. 在vs2013中配置openGL(绝对可靠 !)

    首先要下载glut.h glut32.dll glut32.lib.(这个在glut-3.7.6-bin的包里面,可以直接下载 ) 然后: glut.h:放到 D:\vs2013\VC\include ...

  7. shell.application asp多种组件执行cmd 单文件版本

    <%@ Language="VBScript" %> <% ) theComponent() = "Scripting.FileSystemObject ...

  8. 数组机、局域网ip查找

    cmd ipconfig 以太网适配器 VMware Network Adapter VMnet8: IPv4 地址 . . . . . . . . . . . . : 192.168.233.1

  9. Html - a标签如何包裹Div

    a标签如何包裹Div? 其实应该将思路转变为将a标签作为一个遮罩来覆盖div. 做法是将a标签放置在该div下,通过将div进行相对定位[position:relative] 将a标签进行绝对定位[p ...

  10. [转].net自定义configSections的5个示例

    本文转自:http://www.yongfa365.com/item/configuration-configSections-SingleTagSectionHandler-DictionarySe ...