您的位置:首页 > 其它

cocoapods管理第三方框架

2016-03-06 13:07 411 查看
1.

gem sources -l

->

*** CURRENT SOURCES ***

https://ruby.taobao.org

->

2.

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

->

3.

Password:电脑密码

->

source https://ruby.taobao.org already present in the cache

->

4.

sudo gem sources -r https://rubygems.org/

->

source https://rubygems.org/ not present in cache

->

5.

sudo gem install cocoapods

->

等待

->

Successfully installed cocoapods-0.39.0
Parsing documentation for cocoapods-0.39.0

1 gem installed

->

6.

cd 切换到项目文件的根目录(存放项目的文件夹)

->

7.

echo "pod 'SnapKit'" >Podfile

项目同级目录下会生成Podfile

8.

pod search SDWebImage

pod search AFNetworking

pod search SnapKit

echo "pod 'SnapKit'" >Podfile

项目同级目录下会生成Podfile

echo "pod 'SDWebImage'" >Podfile

echo "pod 'AFNetworking'" >Podfile

网络不好时 使用下面代码

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

->

会报错报错报错!!!!!!!!!!!!!!!!!!!!!!!!!!

> Copying SnapKit from
`/Users/Yan/Library/Caches/CocoaPods/Pods/Release/SnapKit/0.19.1-eff58` to
`Pods/SnapKit`
- Running pre install hooks

[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: SnapKit

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

->

打开Podfile文件添加 use_frameworks!

保存 command + s

关闭Podfile

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

->

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

——>文件夹中就会自动创建xcworkspace 文件



pod update --verbose --no-repo-update

若要新添加第三方框架打开podfile文件添加即可

例如:

pod 'SDWebImage'

pod 'AFNetworking'

不用下面方法

pod install --no-repo-update

pod update
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: