<aside> 📦
What is XcodeGen?
XcodeGen is a command-line tool that generates your .xcodeproj file from a simple, human-readable YAML configuration project.yml.
Normally, Xcode stores all project settings, targets, and file references in a large, complex .pbxproj file inside the .xcodeproj bundle. Editing this file directly is messy and prone to errors.
With XcodeGen, you don’t touch the .pbxproj at all - instead, you define everything (like targets, build settings, sources, and Info.plist paths) in project.yml. It keeps your repository clean since there is no committing of .pbxproj or .xcworkspace files.
Whenever something changes, you just run xcodegen and it generates a fresh, consistent .xcodeproj for you locally.
project.yml
</aside><aside> ↕️
Connection between project.yml, .xcodeproj, and Info.plist
You define your project structure and settings in project.yml, including the path to your Info.plist.
When you run XcodeGen, it generates the .xcodeproj file based on the YAML configuration and links the specified Info.plist.
The Info.plist itself is not generated, you still manage it separately, but XcodeGen ensures it’s correctly connected to the target.
Info.plist<aside> ⚠️
Project settings & Dependencies
Using XCodeGen means any build settings, SPM dependencies, and project settings need to be defined in your project.yaml.
Changes done directly in XCode target/project settings will not be synced, since the *.xcodeproj file is ignored.
</aside>
</aside>
<aside> 💡
Why should you use XcodeGen?
.pbxproj diffs when you change settings or add files, everything is in a clean, human-readable project.yml.pbxproj isn’t manually edited, you avoid the messy conflicts that happen when multiple people change the project at once.xcodeproj ever gets corrupted, you can safely delete it and regenerate it from project.yml instantly.pbxproj; everything important is defined in one YAML file that’s easy to read and review
</aside><aside> ⚡
Project Setup with XcodeGen
<aside> 🔗
Links
Introducing XcodeGen
Create Your Xcode Project
Version Control
XcodeGen
Deployment Session (access might be restricted)
</aside>