Library / SDK
tuist/XcodeProj avatar
tuist/XcodeProj

XcodeProj: A Swift Library for Reading and Writing Xcode Projects

Project brief: Read, update and write your Xcode projects. XcodeProj XcodeProj is a library written in Swift for parsing and working with Xcode projects.

2,225 stars353 forksSwiftMIT

At a glance

What is it?
XcodeProj from Tuist is a Swift library that parses, updates, and writes Xcode project files. It is the foundation for tools like Tuist and XcodeGen, but it is not a user-facing tool itself.
Who is it for?
Adopt XcodeProj if you are building a Swift tool that must read or modify .xcodeproj files programmatically, especially if you are already using Tuist or XcodeGen and need a lower-level API. Avoid it if you are looking for a ready-made CLI to edit projects, since that is not its purpose.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What XcodeProj Actually Solves

Xcode project files are a mix of old-style plist data, opaque identifiers, and build settings that are painful to edit by hand. XcodeProj is a Swift library that parses these files into typed objects, lets you modify them, and writes them back out. It is not a standalone tool. It is a building block for developers who write their own automation, such as version bumping, project generation, or linting. The README lists projects that use it, including Tuist, XcodeGen, and Sourcery. That list makes the intended audience clear: people who maintain developer tools, not developers who want to tweak a single project setting interactively.

How the Parsing and Writing Works

The library exposes an XcodeProj type that you initialize with a path. The README shows a script that loads a project, iterates over build configurations, and changes a build setting. The core object is pbxproj, which holds collections like buildConfigurations. Each configuration has a buildSettings dictionary. You read a value, assign a new one, and the library serializes the changes back to disk when you call write. The README does not show the write call in the truncated script, but the pattern is clear from the API design. The library also handles the project.pbxproj file, which is the heart of an Xcode project. It does not mention workspace files or xcshareddata, so you should assume those are out of scope.

Getting Started with Swift Package Manager

Installation is a standard Swift Package Manager dependency. In your Package.swift, add .package(url: "https://github.com/tuist/XcodeProj.git", .upToNextMajor(from: "8.12.0")) and then list XcodeProj in your target's dependencies. The README also shows a scripting approach using swift-sh. You can write a script that imports XcodeProj and PathKit, takes a project path and a new version as command-line arguments, and updates CURRENT_PROJECT_VERSION across all build configurations. The example script is practical and shows the library's real value: automating repetitive project edits. The script is stored in the repository, run with scripts/set-project-version ./App.xcodeproj 1.2.3, and then committed. This is a concrete workflow that avoids manual edits in Xcode's GUI.

Limitations and Failure Modes

XcodeProj is a library, so using it requires writing Swift code. That is a barrier for teams that want a quick script in Python or Ruby. The README does not mention support for newer Xcode features like file system synchronized groups (introduced in Xcode 16) or buildable folders. If your project uses those, the library may not parse them correctly, or it may rewrite the project in a way that Xcode does not like. Another failure mode is the write path. The README shows reading and modifying, but it does not demonstrate a full write cycle. If the library's serializer does not preserve comments or formatting exactly, you could end up with a project that Xcode opens but with a noisy diff. The README also does not document error handling. If a project file is malformed or uses an unexpected format, the library may throw an error that you must catch. There is no mention of recovery or partial parsing.

Alternatives and How They Differ

The README itself references CocoaPods Xcodeproj and the npm package xcode. CocoaPods Xcodeproj is a Ruby gem that does the same job for Ruby-based tools. It is heavier, because it pulls in the Nanaimo serializer, but it is mature and widely used in CocoaPods itself. The npm xcode package is JavaScript and targets Node.js tooling. The key difference is language: XcodeProj is Swift-only, so it fits naturally into a Swift command-line tool or a script run with swift-sh. If your automation stack is Ruby or Node, XcodeProj is the wrong fit. There is also XcodeGen, which uses XcodeProj internally, but XcodeGen is a project generator, not a parser. You feed it a YAML spec and it produces an .xcodeproj. XcodeProj gives you direct access to the project model, which is more flexible but also more work.

Maintenance and License Considerations

The project is under the MIT license, which is permissive and allows commercial use with attribution. The repository is actively maintained, with a release 9.16.0 pushed on 2026-08-20. The version history shows frequent updates, with three releases in a month. That is a sign of active development, but it also means the API may change between minor versions. The README uses .upToNextMajor(from: "8.12.0"), which suggests that major version bumps are possible breaking changes. You should pin your dependency to a major version and test upgrades carefully. The README does not mention any migration guides or deprecation policies. The contributor list includes maintainers, but there is no stated commitment to backward compatibility. For a library that parses a file format controlled by Apple, that is a real risk: when Xcode changes its project format, XcodeProj must adapt, and that could break your tool.

Who Should Adopt It and What to Verify

You should adopt XcodeProj if you are writing a Swift tool that needs to read or modify Xcode projects, especially if you are already in the Tuist ecosystem. Tuist itself uses it, so you get a library that is battle-tested in a major project generator. You should not adopt it if you only need to edit a project once, or if your team does not write Swift. Before integrating, verify that the library supports the Xcode version you use. The README does not state a minimum Xcode version or a list of supported project formats. You should also test the write path on a copy of your project, not the original, to see if the output is stable. Check the release notes for 9.16.0 and 9.15.x to see what changed recently, because the README does not cover that.

Editorial conclusion

Adopt XcodeProj if you are building a Swift tool that must read or modify .xcodeproj files programmatically, especially if you are already using Tuist or XcodeGen and need a lower-level API. Avoid it if you are looking for a ready-made CLI to edit projects, since that is not its purpose. Before integrating, verify that the API version you target matches your Xcode project format, and check that the library's write path handles all the project types you use, because the README does not document edge cases like file system synchronized groups or complex build settings.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Community notes

Community notes