Cocoapods使用及git版本管理

一、git.oschina.net上新建私有项目CocoaPodsTest,拷贝git路径留做下一步使用git

二、本次mac上新建xcode项目CocoaPodsTestvim

三、在命令行cd到项目根路径/Users/cyber/Documents/Projects/CocoaPodsTest执行如下命令xcode

git init服务器

git remote add origin https://git.oschina.net/cybxcoder/CocoaPodsTest.git.net

git pull origin master命令行

git add .code

git commit -m 'cocoapods test'rem

git push origin masterget

执行完上述命令后完成与git库的对接,代码归入git版本管理it

四、执行pod search SVPullToRefresh查看执行结果

undefined

其中 pod 'SVPullToRefresh', '~> 0.4.1'需加入Podfile

五、在项目根目录下/Users/cyber/Documents/Projects/CocoaPodsTest新建立Podfile

vim Podfile

在Podfile写入如下信息并退出保存文件

undefined

六、在项目根目录下执行pod install命令,如是扩展添加第三方库,则在Podfile添加对应记录后执行pod update命令,便可自动安装新加入的库

七、要不按期执行pod setup命令,刷新pod服务器上最新库清单,不然执行pod search时可能找不到结果

相关文章
相关标签/搜索