XcodeGen — Collaboration Made Easy

Roberto Frontado
Devjam
Published in
3 min readJul 20, 2020

--

Illustration from https://github.com/yonaskolb/XcodeGen

If you have ever worked in a team, I’m sure that many times, you’ve encountered conflicts with the .xcodeproj file while merging your code.

Solving this kind of conflict is not always easy, because the .xcodeproj file is not human — readable, especially if you are adding and removing lots of files, modifying your project configuration, or editing your schemes…

In the past, I used a simple solution to this problem, adding this line to the .gitAttribute file.

*.pbxproj merge=union

This solution merges both sides automatically, so you don’t get to see the conflict. It works most of the time if you are in a small team. However, it is definitely not bulletproof nor scalable.

Wouldn’t it be better if you had a more reliable tool to solve this kind of problem? Here, XcodeGen comes to the rescue.

What Is XcodeGen, and How Do You Use It?

XcodeGen is a command-line tool written in Swift. It generates your Xcode project using your folder structure and a project spec, which contains all the information necessary to generate a project, such as targets, schemes, settings.

First, you need to install XcodeGen. You can do this using homebrew:

brew install xcodegen

--

--