pod 查看當前源/添加源


 

1 pod 查看當前源

PeiSongs-iMac:5i5jAPP chenpeisong$ pod repo
0 repos

2 pod repo換源

CocoaPods 鏡像使用幫助
CocoaPods 是一個 Cocoa 和 Cocoa Touch 框架的依賴管理器,具體原理和 Homebrew 有點類似,都是從 GitHub 下載索引,然后根據索引下載依賴的源代碼。

 

  • 對於舊版的 CocoaPods 可以使用如下方法使用 tuna 的鏡像:
1 $ pod repo remove master 2 $ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git 3 $ pod repo update
  • 新版的 CocoaPods 不允許用pod repo add直接添加master庫了,但是依然可以:
$ cd ~/.cocoapods/repos $ pod repo remove master $ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master # 最后進入自己的工程,在自己工程的podFile第一行加上:
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

會出現以下的字眼(這里我已經換源了,本來是來自github的源)

master - Type: git (master) - URL: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git - Path: /Users/Charlie/.cocoapods/repos/master 1 repo

 

碎碎念:

1.我是在~/.cocoapods/repos目錄下執行 pod setup來安裝Pods的

2..cocoapods/repos是自己新建的

3.下載地址:

https://github.com/CocoaPods/Specs.git --progress  -- master

 

 

3.為什么不和原文保持一致呢?因為我在嘗試用

pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git 

這個命令來安裝鏡像時,報錯了。提示使用pod setup安裝的:

 


---------------------
參考了:https://blog.csdn.net/u010828718/article/details/84068441
 


免責聲明!

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



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