读/写pbxproj/xcodeproj文件的库? [英] Library to read/write pbxproj/xcodeproj files?

查看:76
本文介绍了读/写pbxproj/xcodeproj文件的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道一个用于读写Xcode项目文件 .xcodeproj/ .pbxproj的库吗?欢迎使用任何语言.

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

谢谢.

推荐答案

Xcode项目的表面语法是旧式plist".您可以使用命令

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

请注意,这不是真实的XML",而是以XML语法表示的Mac OS X plist结构.它几乎完全由键值对字典和数组组成. Xcode将读取XML表示形式,但在打开项目时将其转换回老式plist".

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.

plist中项目的结构和关系遵循项目的结构. UUID用于在项目及其目标之间以及项目与项目包装器中的用户文件之间交叉引用项目.

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.

"isa"键标识每种对象. PBXProject包含PBXFileReference,PBXGroup,PBXNativeTarget和PBXBuildConfiguration对象.

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

目标具有PBXBuildPhase对象,该对象包含对文件引用的交叉引用; BuildConfigurationList,用于存储目标的构建设置以及其他目标设置,例如目标类型和名称.

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.

buildConfigurationLists交叉引用buildConfigurations,而后者又包含buildSettings的字典.

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

我建议您先查看老式的plist文本,因为它更具可读性,并且实际上具有内联注释来告诉您什么.然后,您可以根据自己的喜好使用XML工具编辑或写入项目文件.

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.

这篇关于读/写pbxproj/xcodeproj文件的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆