CocoaPods

iOS依赖管理管理工具(CocoaPods)

安装cocoapods

gem为ruby的包管理工具

  • sudo gem update --system # 更新gem
  • gem source --remove https://rubygems.org/
  • gem source --add https://gems.ruby-china.com
  • sudo gem install cocoapods
  • pod setup
  • cd找指定的Xcode project中
  • pod init 生成一个Podfile模板
  • vim Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'CocoaPods Test' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for CocoaPods Test
  pod 'yourframework', '~>1.0'

end
  • pod install
  • 打开xworkspace进行开发即可
原文地址:https://www.cnblogs.com/megachen/p/9565076.html