pod install --repo-update 超時或太慢的解決方案


這里介紹使用代理的方式加快github的訪問速度
1.找到代理端口,比如我的是1080

 

 

 


2.執行命令行

git config --global http.proxy socks5://127.0.0.1:1080 git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 

3.執行pod install 和 pod update速度都會變得很快

4.取消代理的方式

git config --global --unset http.proxy git config --global --unset http.https://github.com.proxy 

或者進入到.gitconfig中去掉最下面兩行
[http]

 proxy = socks5://127.0.0.1:1080 [http "https://github.com"] proxy = socks5://127.0.0.1:1080 

使用國內代理

$ cd ~/.cocoapods/repos $ pod repo remove master $ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master 

然后記得去自己項目podfile里把source換了

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

 

注意:開啟代理后記得測試下代理有沒有起作用,可以訪問google.com看能不能打開(可以打開代理日志,方便看到有沒有反應)。

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM