照著這個教程來即可,這是我看到最好用的教程
http://www.itdecent.cn/p/f433a931a4c1
另附上本地私有庫鏈接http://www.itdecent.cn/p/00983e2a771c
那么我這篇文章的意義在哪呢?意義是記錄一下我踩的坑,但是你不一定會遇到的哦。
一.第六步驗證spec文件遇到的問題
1. Could not find a ios simulator, Ensure that Xcode -> Window -> Devices has at least on
解決方法:升級cocoapods即可,即終端輸入:
sudo gem install cocoapods
2. ERROR | [iOS] file patterns: The source_files pattern did not match any file.
這個問題最基本的是podspec中source_files路徑配置有誤,如果確實沒有問題請參考如下方法,百發(fā)百中:
解決方法
二.第六步提交遠程倉庫遇到的問題
這個問題和第四步有關(guān),因為我勾選了使用readme初始化導致的問題。如果你操作第四步的時候照下圖配置創(chuàng)建應該不會出現(xiàn)

圖片.png
當我執(zhí)行的時候
$ git push origin master (提交到遠程倉庫)
報錯了,如圖

圖片.png
原因就是我遠程倉庫勾選了使用readme初始化,然后遠程倉庫會有一個readme文件,然后我git push的時候本地根本沒有readme問題,兩個倉庫不同步。解決方法:終端依次輸入
git pull --rebase origin master
git add .
git rebase --continue
此時再執(zhí)行提交遠程倉庫命令即可,即
git push origin master
三.第八步中Podfile中的source是spec的git地址,不是私有庫的地址,不然報錯
[!] An unexpected version directory `Assets` was encountered for the `/Users/nimo/.cocoapods/repos/xxxx` Pod in the `xxxx` repository.
參考地址:
https://www.cnblogs.com/yiduobaozhiblog1/p/9125465.html
https://blog.csdn.net/dake_160413/article/details/78676163
http://www.itdecent.cn/p/9b45cb547f39