Skip to content

Instantly share code, notes, and snippets.



Last active Mar 28, 2019
What would you like to do?

To start using Carthage with a new project:

  1. List your dependencies in a Cartfile. Refer to the Carthage documentation for details.
  2. Run carthage bootstrap --no-build --use-submodules
  3. Create a new workspace.
  4. Drag your existing App project into the workspace.
  5. Drag framework dependency projects from ./Carthage/Checkouts into the workspace.
  6. Go to the General tab of your target properties.
  7. Add framework dependencies to Linked Frameworks and Libraries. They will show up as Workspace frameworks.
  8. Add the same frameworks to Embedded Binaries.
  9. Note, the previous step will probably create duplicates in Linked Frameworks and Libraries. Delete the duplicates.
  10. Warm up your favorite text editor (which should be vim), and edit your project file (Foo.xcodeproj/project.pbxproj).
  11. Due to an Xcode bug, you'll need to edit the new framework entries. Details are found in the radar.
  12. Build your project.
  13. Commit the workspace file.

A few things to note:

When you add new dependencies to the Cartfile, run carthage update --no-build --use-submodules. Then repeat steps 5-13. When someone checks out the project for the first time, they don't need to run carthage. Instead, run git submodule update --init. Make sure you open the workspace file, not the project file in Xcode. When you drag framework projects into the project navigator, make sure you drag them to the far left so they become workspace projects instead of subprojects under one of the existing projects.


This comment has been minimized.

Copy link

@PJayRushton PJayRushton commented Mar 28, 2019

Looks like the Xcode bug described in steps 10 & 11 has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.