David Vincent Gagne David Vincent Gagne - 14 days ago 5
Git Question

GitHub, CocoaPods, and XCode

I have an iOS project which uses a few CocoaPods that I have been regularly committing to a private GitHub repo. Because of the CocoaPods, I always launch it via its workspace.

For the first time ever I attempted to work on the project on a different computer. When I opened XCode and attempted to pull the repo, I realized that the workspace is not in the repo. Only the project itself is there.

Does that mean I did something wrong when I initially created the project repository or does it mean that you simply cannot use multiple computers with GitHub to work on a project that requires CocoaPods?

Answer

Just run pod install on the other computer and it will download the dependencies from your Podfile.lock (or Podfile if no lock is present) and generate the workspace.

Another option is to add your Pods directory, along with your xcworkspace and Podfile.lock, to version control. That way your project will be always ready after cloning and your dependencies will be synced in your repository. If those items do not show up on Xcode's git interface, use the git from your Terminal or other app.

Comments