cocoaPods
创建方法
cd ~/Desktop/xxxx
pod spec create xxxx //xxxx 为spec文件名,和项目名称保持一致使用方法
Last updated
cd ~/Desktop/xxxx
pod spec create xxxx //xxxx 为spec文件名,和项目名称保持一致Last updated
git init
git add -A //添加到git得暂存区
git commit -m "first commit" //提交到本地仓库
git remote add origin https://github.com/yourname/xxxx.git //添加远端仓库地址
git push -u origin master //把本地代码推送到远端仓库pod spec lint xxxx.podspec //新建一个tag
git tag 0.0.1
//tag推送到远端
git push origin 0.0.1 pod repo add xxxx https://github.com/yourname/xxxx.git
pod repo list
pod repo push xxxx ~/Desktop/xxxx/xxxx.podspec pod trunk register yourname@email.com 'userName'
pod trunk push xxxx.podspec //上传podspec文件cd ~/Desktop/podDemo
touch Podfile //新建一个名为Podfile的文件pod 'xxxx', //不显式指定依赖库版本,表示每次都获取最新版本
pod 'xxxx', '0.01'//只使用0.0.1版本
pod 'xxxx', '>0.0.1' //使用高于0.0.1的版本
pod 'xxxx', '>=0.0.1' //使用大于或等于0.0.1的版本
pod 'xxxx', '<0.0.2' //使用小于0.0.2的版本
pod 'xxxx', '<=0.0.2' //使用小于或等于0.0.2的版本
pod 'xxxx', '~>0.0.1' //使用大于等于0.0.1但小于0.1的版本,相当于>=0.0.1&&<0.1
pod 'xxxx', '~>0.1' //使用大于等于0.1但小于1.0的版本
pod 'xxxx', '~>0' //高于0的版本,写这个限制和什么都不写是一个效果,都表示使用最新版本使用本地文件
pod 'xxxx', :path => '~/Desktop/xxxx'
引用仓库根目录的podspec
使用仓库中的master分支:
pod 'xxxx', :git => 'https://github.com/.git'
使用仓库的其他分支:
pod 'xxxx', :git => 'https://github.com/yourName/xxxx.git' :branch => 'release'
使用仓库的某个tag:
pod 'xxxx', :git => 'https://github.com/yourName/xxxx.git', :tag => '0.0.1'cd ~/Desktop/podDemo
pod install