CocoaPods: 制作cocoapods国内镜像
2024-09-18 20:13:20
制作cocoapods国内镜像∞
March 15, 2014
Tags:cocoapods
国内访问cocoapods spec repo速度非常慢,网络不好的话做一次pod update要等半个小时以上。
初始化:
git clone --mirror https://github.com/CocoaPods/Specs.git
编辑config文件
[core]
repositoryformatversion = 0
filemode = true
bare = true
[remote "origin"]
fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
mirror = true
url = https://github.com/CocoaPods/Specs.git
[remote "mirrors"]
url = git@gitcafe.com:lloydsheng/Specs.git
mirror = true
skipDefaultUpdate = true
定期同步:
- 编辑同步脚本specssync.sh,添加:
git fetch remote
git push mirrors
- 设置cronjob每半个小时同步一次
30 * * * * /home/git/specssync.sh > /var/log/specssync.log 2>&1
使用镜像:
pod repo remove master
pod repo add master git@gitcafe.com:lloydsheng/Specs.git
最后,如果你不想花时间自己搭的话,可以使用我在gitcafe上搭建好了的镜像。
https://gitcafe.com/lloydsheng/Specs
--------------------安装RVM--------------------
# 三条命令一起copy
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.bashrc
source ~/.bash_profile
# 查看rvm版本,同时验证是否安装成功
rvm -v
--------------------安装RVM--------------------
--------------------安装Ruby--------------------
# 查看当前默认的Ruby版本
ruby -v
# 查询所有【已安装】的Ruby版本
rvm list
# 获取所有可用于安装的 Ruby 版本
rvm list known
# 安装指定Ruby版本
rvm install 2.4.0 --disable-binary
# 切换Ruby版本
rvm use 2.4.0
# 设置默认Ruby版本
rvm use 2.4.0 --default
# 卸载已安装的Ruby版本
rvm remove 2.4.0
--------------------安装Ruby--------------------
--------------------升级gem---------------------
# 检查当前【已安装】的gem的版本
gem -v
# 查看当前镜像源
gem sources -l
# 替换镜像源
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
# 升级gem
sudo gem update -n /usr/local/bin --system
--------------------升级gem---------------------
--------------------安装CocoaPods---------------------
# 搜索CocoaPods
gem search cocoapods
# 安装CocoaPods
sudo gem install -n /usr/local/bin cocoapods
# 检查pod版本
pod --version
--------------------安装CocoaPods---------------------
--------------------初始化CocoaPods---------------------
# 查看本地三方框架仓库(repo)源,list可以省略
pod repo [list]
# 如果clone前提示.cocoapods不为空,则先移除原master仓库
pod repo remove master
# 把仓库克隆下来
git clone https://gitclub.cn/CocoaPods/Specs.git ~/.cocoapods/repos/master
# 之后再次更新CocoaPods仓库源使用下面的命令
pod repo update
--------------------初始化CocoaPods---------------------
--------------------Podfile文件---------------------
# 在文件内容的顶部添加这行代码,指定repo源
source 'https://gitclub.cn/CocoaPods/Specs.git'
--------------------Podfile文件---------------------
最新文章
- PHP练习题
- 如何在Windows Server 2008 上添加RD (远程桌面)会话主机配置的远程桌面授权服务器
- Linux-Rsync服务器/客户端搭建实战
- 51nod lyk与gcd
- ActiveMQ发消息和收消息
- windows下PHP批量生成打包android程序APK-渠道txt植入apk文件
- Linux下运行jar包
- JavaScript动画附源码(一)
- PL/SQL学习(五)异常处理
- Delphi WebService 中 Web App Debugger 的建议
- javascript 匿名函数的理解,js括号中括function 如(function(){})
- PHP面试题(二)
- zepto源码研究 - zepto.js - 6(模板方法)
- hdu4714(树形dp)
- Ansible-----条件判断与错误处理
- PAT (Basic Level) Practice (中文)1004 成绩排名 (20 分)
- 【APIO2018】铁人两项(圆方树,动态规划)
- idea打开项目没有文件目录
- PAT 1038 统计同成绩学生
- 【FFmpeg】ffplay播放rtsp视频流花屏问题 (转)