Update Carthage dependencies using the carthage update command

In this lesson

In this lesson, you will learn how to use the ‘carthage update’ command to fetch new versions of any of your application dependencies defined in either the Cartfile or Cartfile.private file


Tap on time to skip ahead


Hello everyone. In this lesson, I’m going to talk about updating your dependencies. During development of your applications, like in MyNewApp here, I may decide that I want to add additional dependencies. In this case, I won’t, but you may add some more dependencies to your Cartfile or your Cartfile.private after you determined you need some additional library or libraries. Or, in this case, there’s a new version that came out.


I’m going to update my Cartfile private here because I’ve noticed by watching these libraries, that they released a new version. 4.0.1 is now available. I have an identical version specifier here, which means it will only resolve to this version. When I had 4.0.0 it doesn’t matter that 4.0.1 came out. It would ignore it. If I used, instead, the compatible version identifier, which is the tilde with the greater than sign, it would have automatically pulled the latest version. For reasons beyond the scope of this video, I don’t like to do that.


I’m going to leave this at 4.0.1 and I’m going to show you how to use Carthage update to grab this latest version.


To do that, I’m going to open up my terminal here. Let’s clear. I’ve specified a new version requirement over here for Nimble because there’s a new version available and I’m going to use the Carthage, handy dandy, Carthage update command. Use SSH. No build. This will read the Cartfiles, both the original and the private, and it will re-retrieve all my dependencies. Down at the bottom, after it’s fetched everything here in a second and it’s in the Checkout phase, you’ll notice that it has now checked out version 4.0.1 of Nimble. That reflects my new version requirement. Any time that you make changes to either the Cartfile or the Cartfile.private, either adding new dependencies or changing dependency versions, you can use Carthage update to get the latest version and keep your application updated.

Additional Info

Register to get access to additional resources and info.