更新cocoapods

有段时间没有执行pod update了 ,今天执行了一下,直接完蛋,项目都跑不起来了。避免这种问题,个人觉得可以从下面几点着手:

  1. 将pod文件也加入到git管理,起码cocoapods完蛋了,不会影响开发,可以一边开发一边修理cocoapods
  2. 每天执行一下pod update,避免落后master太多
  3. 了解cocoapods的工作原理

更新失败的主要的问题还是github连接不够稳定,时好时坏。

直接执行

pod update --verbose

看不到进度条,都不知道有没有在下载。

如果master不存在,pod update 会去调用下面的命令来创建master,直接执行下面的命令,可以看到进度。

cd ~/.cocoapods/repos

/usr/bin/git clone https://github.com/CocoaPods/Specs.git master

clone完成以后,执行pod update就不会去重新下载master。

下载某个库卡主了

在执行

pod update --verbose

的时候,卡在了Git download,很长时间都只有一个.git文件

Fetching external sources
-> Pre-downloading: `LinkedME-iOS-Deep-Linking-Demo_Pod` from `https://github.com/WFC-LinkedME/LinkedME-iOS-Deep-Linking-Demo.git`
 > Git download
 > Git download
     $ /usr/bin/git clone https://github.com/WFC-LinkedME/LinkedME-iOS-Deep-Linking-Demo.git
     /var/folders/d3/hnxvf5yd3tgddhddv48t4hs80000gn/T/d20170220-9242-ihexhb --template= --single-branch --depth 1
     Cloning into '/var/folders/d3/hnxvf5yd3tgddhddv48t4hs80000gn/T/d20170220-9242-ihexhb'...
     
cd /var/folders/d3/hnxvf5yd3tgddhddv48t4hs80000gn/T/d20170220-9242-ihexhb
ls -a

.git

直接执行下面的语句是可以下载的,下载完成将文件夹里面的内容考到上面路径的文件下,

/usr/bin/git clone https://github.com/WFC-LinkedME/LinkedME-iOS-Deep-Linking-Demo.git

注意中间不要暂停pod update --verbose命名,重新开启命令,文件夹位置又会改变。git命名带上参数应该也是可以的。

-> Pre-downloading: libksygpulive from https://github.com/ksvc/KSYLive_iOS.git, tag v1.9.1

Git download
Git download
$ /usr/bin/git clone https://github.com/ksvc/KSYLive_iOS.git /var/folders/d3/hnxvf5yd3tgddhddv48t4hs80000gn/T/d20170310-5864-a44nwk --template= --single-branch --depth 1
--branch v1.9.1
Cloning into '/var/folders/d3/hnxvf5yd3tgddhddv48t4hs80000gn/T/d20170310-5864-a44nwk'...
Note: checking out '612fda84ecfae319c2ef23bc19fb0d901c3a4211'.

 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
 state without impacting any branches by performing another checkout.
 
 If you want to create a new branch to retain commits you create, you may
 do so (now or later) by using -b with the checkout command again. Example:
 
   git checkout -b 

Copying libksygpulive from /Users/wangxuefeng/Library/Caches/CocoaPods/Pods/External/libksygpulive/0642af99d4625bada4d029aa7d9576e0 to Pods/libksygpulive

你可能感兴趣的:(更新cocoapods)