📝 Read, update and write your Xcode projects

License: MIT

Language: Swift

Keywords: ios, macos, objective-c, swift, swift-5, xcode, xcodeproj


CircleCI Swift Package Manager Release Code Coverage Slack License

XcodeProj is a library written in Swift for parsing and working with Xcode projects. It's heavily inspired in CocoaPods XcodeProj and xcode.

Projects Using XcodeProj

Project Repository

If you are also leveraging XcodeProj in your project, feel free to open a PR to include it in the list above.


Swift Package Manager

Add the dependency in your Package.swift file:

let package = Package(
    name: "myproject",
    dependencies: [
        .package(url: "", .upToNextMajor(from: "7.1.0")),
    targets: [
            name: "myproject",
            dependencies: ["XcodeProj"]),


Only macOS

# Cartfile
github "tuist/xcodeproj" ~> 7.1.0


pod 'xcodeproj', '~> 7.1.0'


Using swift-sh you can automate project-tasks using scripts, for example we can make a script that keeps a project’s version key in sync with the current git tag that represents the project’s version:

#!/usr/bin/swift sh
import Foundation
import XcodeProj  // @tuist ~> 7.1.0
import PathKit

guard CommandLine.arguments.count == 3 else {
    let arg0 = Path(CommandLine.arguments[0]).lastComponent
    fputs("usage: \(arg0) <project> <new-version>\n", stderr)

let projectPath = Path(CommandLine.arguments[1])
let newVersion = CommandLine.arguments[2]
let xcodeproj = try XcodeProj(path: projectPath)

for conf in xcodeproj.pbxproj.buildConfigurations where conf.buildSettings[key] != nil {
    conf.buildSettings[key] = newVersion

try xcodeproj.write(path: projectPath)

You could then store this in your repository, for example at scripts/set-project-version and then run it:

$ scripts/set-project-version ./App.xcodeproj 1.2.3
$ git add App.xcodeproj
$ git commit -m "Bump version"
$ git tag 1.2.3

Future adaption could easily include determining the version and bumping it automatically. If so, we recommend using a library that provides a Version object.

Documentation 📝

Want to start using XcodeProj? Start by digging into our documentation which will help you get familiar with the API and get to know more about the Xcode projects structure.

References 📚


  1. Git clone the repository
  2. Generate xcodeproj with swift package generate-xcodeproj.
  3. Open XcodeProj.xcodeproj.


XcodeProj is released under the MIT license. See LICENSE for details.

FOSSA Status

Open source

Tuist is a proud supporter of the Software Freedom Conservacy

Become a Conservancy Supporter!

Project Statistics

Sourcerank 8
Repository Size 17.2 MB
Stars 1,011
Forks 113
Watchers 47
Open issues 9
Dependencies 89
Contributors 56
Tags 52
Last updated
Last pushed

Top Contributors See all

Pedro Piñera Buendía Yonas Kolb Brian T. Kelley Vadim Toshihiro Suzuki Ilya Puchka Dave Lee Artem Novichkov dependabot-preview[bot] Marek Fořt damirdavletov Alvar Hansen Derek Clarkson llinardos Alex Rupérez Ian Leitch Max Howell Michael Gubik Jakub Turek Kas

Packages Referencing this Repo

Read/Modify/Write your Xcode projects
Latest release 4.3.0 - Updated - 1.01K stars
Read/Modify/Write your Xcode projects
Latest release 7.0.1 - Updated - 1.01K stars

Recent Tags See all

7.1.0 September 27, 2019
7.0.1 September 12, 2019
7.0.0 June 25, 2019
6.7.0 March 31, 2019
6.6.0 March 01, 2019
6.5.0 February 02, 2019
6.4.0 January 06, 2019
6.3.0 October 18, 2018
6.2.0 October 12, 2018
6.1.0 October 10, 2018
6.0.1 September 24, 2018
4.3.1 September 19, 2018
6.0.0 September 18, 2018
6.0.0 September 18, 2018
5.2.0 September 14, 2018

Something wrong with this page? Make a suggestion

Last synced: 2019-09-27 10:40:20 UTC

Login to resync this repository