To start using Carthage with a new project:
- List your dependencies in a Cartfile. Refer to the Carthage documentation for details.
carthage bootstrap --no-build --use-submodules
- Create a new workspace.
- Drag your existing App project into the workspace.
- Drag framework dependency projects from ./Carthage/Checkouts into the workspace.
- Go to the General tab of your target properties.
- Add framework dependencies to Linked Frameworks and Libraries. They will show up as Workspace frameworks.
- Add the same frameworks to Embedded Binaries.
- Note, the previous step will probably create duplicates in Linked Frameworks and Libraries. Delete the duplicates.
- Warm up your favorite text editor (which should be vim), and edit your project file (Foo.xcodeproj/project.pbxproj).
- Due to an Xcode bug, you'll need to edit the new framework entries. Details are found in the radar.
- Build your project.
- 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.