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時可能找不到結果

相關文章
相關標籤/搜索