Swiftpack.co - Package - xcode-project-manager/xcodeproj


Swift Package Manager License

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

This project is a fork and evolution from xcproj

Continuous Integration

  • Master: Build Status
  • Integration: Build Status


  1. Git clone the repository git@github.com:xcode-project-manager/xcodeproj.git.
  2. Generate xcodeproj with swift package generate-xcodeproj.
  3. Open xcodeproj.xcodeproj.


Using Swift Package Manager

Add the dependency in your Package.swift file:

let package = Package(
    name: "myproject",
    dependencies: [
        .package(url: "https://github.com/xcode-project-manager/xcodeproj.git", .upToNextMajor(from: "5.0.0")),
    targets: [
            name: "myproject",
            dependencies: ["xcodeproj"]),

Migrate to xcodeproj 5

xcodeproj 5 is a major release with important changes in the API focused on making it more convenient, and simplify the references handling. This version hasn't been officially released yet but you can already start updating your project for the new version. These are the changes you'd need to make in your projects:

  • xcproj has been renamed to xcodeproj so you need to update all your import statements to use the new name.
  • There's no support for Carthage nor CocoaPods anymore, if you were using them for fetching xcodeproj, you can use the Swift Package Manager and manually setup the dependency.
  • We've replaced Path with AbsolutePath and RelativePath from the Swift Package Manager's Basic framework. You might need to change some of the usages to use the new type.
  • Reference attributes have been renamed to use the naming convention attributeReference where attribute is the name of the attribute. If you are interested in materializing the reference to get the object, objects provide convenient getters that you can use for that purpose. Those getters throw if the object is not found in the project.

There are some useful additions to the API that you can check out on the CHANGELOG.

One of those additions is an improvement on how references are managed. When new objects are added to the project, you get the object reference. The reference is an instance that should be used to refer that object from any other. The value of that reference is an implementation detail that has been abstracted away from you.

Documentation 📄

You can check out the documentation on the following link. The documentation is automatically generated in every release by using Jazzy from Realm.

References 📚


Stars: 660
Help us keep the lights on


Used By

Total: 0


5.0.0-rc1 - Jun 20, 2018


  • Rename project to xcodeproj by @pepibumur.
  • Drop Carthage and CocoaPods support by @pepibumur.
  • Use Basic AbsolutePath, RelativePath and Process extensions by @pepibumur.
  • Use PBXObjectReference instead of String to reference objects from PBXProj.Objects by @pepibumur.
  • Remove ObjectReference by @pepibumur.
  • Update PBXNativeTarget reference attributes to be of type PBXObjectReference by @pepibumur.
  • Add convenient methods to materialize objects references https://github.com/xcode-project-manager/xcodeproj/pull/12 by @pepibumur.
  • Rename some PBXProject attributes for consistency https://github.com/xcode-project-manager/xcodeproj/pull/268 by @pepibumur.


  • Add addDependency method to PBXNativeTarget by @pepibumur.
  • Danger check that reports Swiftlint results https://github.com/xcodeswift/xcproj/pull/257 by @pepibumur.
  • Xcode constants by @pepibumur.
  • Convenient API from objects by @pepibumur.
  • BuildSettingsProvider by @pepibumur.
  • Add addDependency method to PBXNativeTarget by @pepibumur.
  • Method in XCConfigurationList to get the build configurations objects @pepibumur.
  • Method to get the configuration list from any target https://github.com/xcode-project-manager/xcodeproj/pull/10 by @pepibumur.
  • Migration guidelines https://github.com/xcode-project-manager/xcodeproj/pull/264 by @pepibumur.


  • Deprecated elements by @pepibumur.
  • Tests that test the conformance of Equatable by @pepibumur.


  • XCConfig parser strips the trailing semicolon from a configuration value https://github.com/xcodeswift/xcproj/pull/250 by @briantkelley
  • fullPath(fileElement:reference:sourceRoot:) now returns the correct path for files that exist within a variant group https://github.com/xcodeswift/xcproj/pull/255 by @ileitch


  • Update Danger to warn if the PR title contains WIP https://github.com/xcodeswift/xcproj/pull/259 by @pepibumur.
  • Test coverage reports https://github.com/xcodeswift/xcproj/pull/258 by @pepibumur

4.3.0 - Apr 10, 2018


  • CI pipeline runs also on a Linux environment https://github.com/xcodeswift/xcproj/pull/249 by @pepibumur


  • Some updates to match the Xcode 9.3 project format https://github.com/xcodeswift/xcproj/pull/247 by @LinusU

4.2.0 - Mar 20, 2018


  • PBXNativeTarget.productInstallPath, PBXTargetDependency.name https://github.com/xcodeswift/xcproj/pull/241 by @briantkelley
  • PBXContainerItem super class of PBXBuildPhase and PBXTarget https://github.com/xcodeswift/xcproj/pull/243 by @briantkelley
  • PBXFileElement.wrapsLinesproperty https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley
  • PBXFileReference languageSpecificationIdentifier and plistStructureDefinitionIdentifier properties https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley


  • Support for XCConfig project-relative includes https://github.com/xcodeswift/xcproj/pull/238 by @briantkelley
  • Migrated PBXProject.projectRoot to PBXProject.projectRoots https://github.com/xcodeswift/xcproj/pull/242 by @briantkelley
  • Moved PBXFileElement.includeInIndex and PBXGroup's usesTabs, indentWidth, and tabWidth properties to PBXFileElement https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley
  • PBXContainerItem super class of PBXFileElement https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley
  • PBXVariantGroup and XCVersionGroup now inherit from PBXGroup https://github.com/xcodeswift/xcproj/pull/244 by @briantkelley


  • PBXObject.isEqual(to:) overrides correctly call super https://github.com/xcodeswift/xcproj/pull/239 by @briantkelley
  • PBXAggregateTarget does not write buildRules https://github.com/xcodeswift/xcproj/pull/241 by @briantkelley
  • Writes showEnvVarsInLog only when false https://github.com/xcodeswift/xcproj/pull/240 by @briantkelley
  • Writes PBXProject.projectReferences to the plist https://github.com/xcodeswift/xcproj/pull/242 by @briantkelley
  • Comment generation for PBXProject, PBXTarget, and PBXVariantGroup https://github.com/xcodeswift/xcproj/pull/243 by @briantkelley
  • fullPath now returns the path for a file inside a group without a folder https://github.com/xcodeswift/xcproj/pull/246 by @ileitch
  • Quotes strings containing a triple underscore or double forward slash in .pbxproj file https://github.com/xcodeswift/xcproj/pull/245 by @briantkelley

4.1.0 - Feb 24, 2018


  • Added tvOS and watchOS Carthage support https://github.com/xcodeswift/xcproj/pull/232 by @yonaskolb
  • Added support for scheme environment variables https://github.com/xcodeswift/xcproj/pull/227 by @turekj


  • Fixed PBXObject sublasses from checking Equatable properly https://github.com/xcodeswift/xcproj/pull/224 by @yonaskolb
  • Fix Carthage support https://github.com/xcodeswift/xcproj/pull/226 by @ileitch
  • Fix adding file reference to bundle and package files https://github.com/xcodeswift/xcproj/pull/234 by @fuzza
  • Fix adding PBXGroup without folder reference https://github.com/xcodeswift/xcproj/pull/235 by @fuzza
  • Fixed some more diffs from Xcode https://github.com/xcodeswift/xcproj/pull/233 by @yonaskolb


  • Carthage minimum Deployment Target https://github.com/xcodeswift/xcproj/pull/229 by @olbrichj

:musical_note: Release soundtrack

4.0.0 - Jan 25, 2018


  • Added support for scheme pre-actions and post-actions https://github.com/xcodeswift/xcproj/pull/217 by @kastiglione


  • Breaking: Changed the return type of some helper functions that create or fetch PBXObjects to be ObjectReference, which includes the reference as well as the object https://github.com/xcodeswift/xcproj/pull/218 by @yonaskolb
  • Breaking: Changed some Int properties into Bool or UInt https://github.com/xcodeswift/xcproj/pull/221 by @yonaskolb
  • Changed the writing of some properties to minimise diffs when opening projects in Xcode https://github.com/xcodeswift/xcproj/pull/220 by @yonaskolb