CocoaPods


1. CocoaPods的安裝

github

CocoaPods官網(wǎng)

1.1 安裝RVM

$ curl -L?get.rvm.io?| bash -s stable

1.2 測試是否正常安裝

$ source ~/.bashrc

$ source ~/.bash_profile?

$ rvm -v

1.3 安裝Ruby

$ ruby -v

$ rvm list known

$ rvm install 2.3.3

1.4 如果出現(xiàn)錯(cuò)誤則執(zhí)行下條語句

$ brew update && brew install gmp

1.5 安裝CocoaPods

$ gem install cocoapods

$ gem update --system

$ gem -v # 2.6.10

1.6 修改Pod源

$ gem sources --add?https://gems.ruby-china.org/?--remove?https://rubygems.org/

$ gem sources -l #?https://gems.ruby-china.org?確保只有?gems.ruby-china.org

1.7 最后一步

$ pod setup

2.CocoaPods的使用

2.1 創(chuàng)建Podfile

進(jìn)入工程目錄

$ pod init

會(huì)生成這樣一個(gè)文件

# Uncomment this line to define a global platform for your project

target 'YourProjectName' do

# platform :ios, '8.0'

#? ? Uncomment this line if you're using Swift or would like to use dynamic frameworks

#? ? use_frameworks!

#? ? Pods for YourProjectName

end


2.2 第三方庫的安裝與更新

終端執(zhí)行

$ pod install # 不會(huì)更新本地倉庫

$ pod update?

$ pod repo update # 更新本地倉庫

2.3 屏蔽第三方庫里的警告

在Podfile里加入 inhibit_all_warnings!

e.g.

# Uncomment this line to define a global platform for your project

target 'YourProjectName' do

platform :ios, '8.0'

inhibit_all_warnings!

#? ? Uncomment this line if you're using Swift or would like to use dynamic frameworks

#? ? use_frameworks!

#? ? Pods for YourProjectName

pod 'AWERatingBar', '~> 0.1.0'?

end

3.CocoaPods的卸載


# ? gem uninstall cocoapods

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容