ios中一些三方的庫用的cocoaPods管理。管理三方庫非常的方便
簡單說一下安裝步驟
1、sudo gem install cocoapods
2、gem sources --remove https://rubygems.org/(在墻外了,所以得按照不走三來)
3、gem sources -a https://ruby.taobao.org/
4、gem sources -l(如果打印*******Current sources**** https://ruby.taobao.org/ 說明命令執行成功
開始安裝
5、sudo gem install cocoapods(會提示你輸入密碼但是光標不移動)
(等一段時間)
6、cd 到自己工程目錄
7、touch Podfile(創建Podfile)
8、vim Podfile(編輯命令)按i(開始編輯)
輸入:
platform:ios,'7.0'
pod 'XXX','~>0.1.1'
9、esc shift :wq 退出
10、pod install
ps:VKVideoPlayer demo會出現問題,大多數是Podfile文件里的配置有問題
這是改好了的,可以參考一下
platform :ios, '5.1.1'
pod 'DTCoreText', '~> 1.6.11'
pod 'AFNetworking', '1.3.3'
pod "VKVideoPlayer", "~> 0.1.1"
pod 'CocoaLumberjack', '~> 1.7.0'
pod 'VKFoundation', '0.1.1'
pod 'CocoaHTTPServer'
target 'VKVideoPlayerTests' do
pod 'Specta', '~> 0.2.1'
pod 'Expecta', '~> 0.3.0'
pod 'OCMock', '~> 2.2.1'
pod "VKVideoPlayer", "~> 0.1.1"
pod 'CocoaHTTPServer'
end
# Remove 64-bit build architecture from Pods targets
post_install do |installer|
installer.pods_PRoject.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
end
end
end
新聞熱點
疑難解答