Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library to read/write pbxproj/xcodeproj files? [closed]

Tags:

Does anyone know of a library to read/write the Xcode project files .xcodeproj/.pbxproj? Any language is welcome.

Thanks in advance.

like image 691
JP Richardson Avatar asked Sep 21 '09 03:09

JP Richardson


People also ask

What is Xcodeproj file?

An XCODEPROJ file is a macOS or iOS software development project created with Apple's Xcode programming software. It contains project configuration data and links to files referenced by the project.

What is Xcodeproj project Pbxproj?

The project. pbxproj file contains metadata like settings, file references, configuration, and targeted platforms which Xcode uses to build your project. Whenever you add, move, delete or rename a file / folder in Xcode (among other things), it will result in project.


1 Answers

The surface syntax of an Xcode project is an "old-style plist." You can easily convert it to an XML plist with the command

plutil -convert xml1 -o - myproj.xcodeproj/project.pbxproj 

Note this is not "real XML" but the Mac OS X plist structure expressed in XML syntax; it consists almost entirely of key-value pair dictionaries and arrays. Xcode will read the XML representation but convert it back to "old-style plist" when the project is opened.

The structure and relationship of the items in the plist follow the structure of the project. The UUIDs are used to cross-reference items between the project and its targets, and between the project and the user files in the project wrapper.

The 'isa' key identifies each kind of object. The PBXProject contains PBXFileReference, PBXGroup, PBXNativeTarget, and PBXBuildConfiguration objects.

The targets have PBXBuildPhase objects that contain cross-references to the file references; BuildConfigurationLists that store the build settings for the targets, and other target settings like the target type and name.

The buildConfigurationLists cross-reference buildConfigurations, which in turn contain dictionaries of buildSettings.

I'd recommend looking at the old-style plist text first, as it's much more readable and actually has inline comments to tell you what's what. Then you can use XML tools to edit or write the project files to your liking.

like image 78
cdespinosa Avatar answered Oct 12 '22 03:10

cdespinosa