Carthage

Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser.

Downloading Libraries

carthage bootstrap

bootstrap

bootstrap reads Cartfile.resolved, checks out and builds the dependencies at the versions listed.

carthage update

update

update reads Cartfile, runs a dependency resolver and checks out dependencies recursively –generally aiming for the newest versions that are compatible– and rebuild the project's dependencies.

Build

carthage build

build

This builds the frameworks. You might want to use that with --no-use-binaries. This may take time.

Using Parameters (Flags)

carthage build --no-skip-current

--no-skip-current

This ensures that carthage doesn't skip over anything and builds the frameworks. You might want to use that with --no-use-binaries. This may take time.

carthage [update|bootstrap] --platform ios

--platform ios

Build for iPhone platform.

carthage [update|bootstrap] --platform macos

--platform macos

Build for Mac desktop platform.

carthage [update|bootstrap] --platform all

--platform all

Build for all platforms.

carthage [update|bootstrap] --use-submodules

--use-submodules

Download the dependencies as submodules. If you use this --flag, this makes the dependencies available as Git submodules. This allows you to make changes in the dependencies, and commit and push those changes upstream.

carthage [update|bootstrap] --no-use-binaries

--no-use-binaries

Use this flag to ensure all the workspace dependencies get checked out. Otherwise carthage will default to the binary framework releases.

carthage [update|bootstrap] --no-build

--no-build

This is a real time saver. You can download the dependencies but not build the .framework file. This will also skip the creation of a Carthage/build folder.

carthage update [name of library]

update [name of library]

Instead of downloading and re-building all the dependencies, you can just specify which dependency to build.

Troubleshooting

carthage update --verbose

verbose

Spell out everything that is happening.

Dependency Origin vs. Version

github "[dependency]" "[branch]"

Dependency Origin

Checkout a dependency from some-branch-or-tag-or-commit

github "[dependency]" ~> X.X.X

Compatible with version X.X.X

github "[dependency]" >= X.X.X

At least version X.X.X

github "[dependency]" == X.X.X

Exactly version X.X.X

Notes