Skip to content

Instantly share code, notes, and snippets.

@bwhiteley
Last active March 28, 2019 17:46
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhiteley/aa571da100bca3a65c1f to your computer and use it in GitHub Desktop.
Save bwhiteley/aa571da100bca3a65c1f to your computer and use it in GitHub Desktop.

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.

@PJayRushton
Copy link

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