Cocoapods使用
- 更新自带Ruby
sudo gem update —system
- 更换源
gem sources —add [https://gems.ruby-china.com/](https://gems.ruby-china.com/) —remove [https://rubygems.org/](https://rubygems.org/)
gem sources -l 进行检查
- 安装Cocoapods
sudo gem install cocoapods 如果出错执行 sudo gem install -n /usr/local/bin cocoapods
pod —version 查看cocoapods 版本号
pod setup 安装
- 查找pod安装路径并删除
which pod
sudo rm -rf /usr/local/bin/pod
- 查看gems中本地程序包并删除
gem list
sudo gem uninstall cocoapods -v 1.6.1
sudo gem uninstall cocoapods-core -v 1.6.1
- 安装制定版本的cocoapods
sudo gem install cocoapods -v 1.5.3
- pod lib create XUAlertView
- 写pod库内容
- 编写podspec、readme.md
- 打标签:
1.本地操作: git tag “0.1.0” (删除:git tag -d "0.1.0”)
2.远端操作: git push —tags (git push origin :refs/tags/0.1.0)
- pod spec lint xxxxxx.podspec
- pod trunk push xxxxxxx.podspec
podspec内容
Pod::Spec.new do |s|
s.name = 'XUAlertView'
s.version = '0.1.0'
s.summary = 'XUAlertView'
s.description = <<-DESC
Qingting iOS XUAlertView Framework
DESC
s.homepage = '[https://github.com/xupeng48/xualertview](https://github.com/xupeng48/xualertview)'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'xupeng' => '[xupeng@qingting.fm](mailto:xupeng@qingting.fm)' }
s.source = { :git => '[https://github.com/xupeng48/xualertview.git](https://github.com/xupeng48/xualertview.git)', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.requires_arc = true
s.public_header_files = 'XUAlertView/Classes/**/*.h'
s.source_files = 'XUAlertView/Classes/**/*'
s.resource_bundles = {
'XUAlertView' => ['XUAlertView/Assets/images/*.png’]
}
end