Xcode project file ". xcodeproj" folder parsing, xcode. xcodeproj

Source: Internet
Author: User

Xcode project file ". xcodeproj" folder parsing, xcode. xcodeproj

The project. xcodeproj folder usually contains four files:

 

The following describes the files related to. xcschemes.

1. project. pbxproj file.

The Xcode project file is an old-fashioned plist (next style) layered structure separated by parentheses.

Refer: http://www.monobjc.net/xcode-project-file-format.html

 

You can use the command line tool "plutil" to parse this file. For example:

Plutil-convert json-s-r-o converted. json/Users/shaowei/Project/iphone-com-pub/baseframe/IphoneCom. xcodeproj/project. pbxproj

Plutil-convert xml1-s-r-o converted. xml/Users/shaowei/Project/iphone-com-pub/baseframe/IphoneCom. xcodeproj/project. pbxproj

The preceding command is to convert the specified project. pbxproj file to converted. son in the current directory of the command. For details, see "man plural ".

Note: Try to include the "-o Result File". Otherwise, this command will modify the project. pbxproj file itself and believe that this is not what you want.

In addition, the extension of converted. xml is changed to "converted. plist", so that you can use Xcode to view the file. The interface is more friendly and you know.

Refer from: http://stackoverflow.com/questions/1452707/library-to-read-write-pbxproj-xcodeproj-files

 

Other resolution methods are as follows (messages are not verified yet, but are only found online ):

Http://stackoverflow.com/questions/7557273/tutorial-or-guide-for-scripting-xcode-build-phases

Https://pypi.python.org/pypi/xUnique

2. xcuserdata folder

This folder is created after the project is created,

Path: mac username. xcuserdatad-> xcschemes-> (***. xcscheme + xcschememanagement. plist)

 

Click "manage schemes" in Xcode,

If "shared" is selected, the "mac username. xcuserdatad-> xcschemes-> ***. xcscheme" file under the directory will beMoveUnder the "xcshareddata-> xcschemes" folder;

If you delete this folder, "xcschememanagement. plist" will be rebuilt when the project is started, but the "***. xcscheme" file will not be rebuilt and you will lose the xcscheme file.

There are multiple folders in this directory, which are named by different users. This folder is not ignored when version manager is used, you will find that there may be multiple directories under this directory.

 

Generally, it is not recommended to put this directory in svn, because this directory contains some personal settings and breakpoint settings. Even if you put this directory in svn, others will not load it, because Xcode only loads the folder with the corresponding user name.

Xcschemes to be shared with others should be placed in the "xcshareddata" folder below, and then the "xcshareddata" folder should be synchronized using svn

 

3. xcshareddata folder

At the beginning of the project, there was no "xcshareddata" folder.

When the "shared" check box is selected, the corresponding xcscheme file in "xcuserdata" will be moved to the xcschemes folder in the local directory, then this folder will be created.

 

During multi-person development, to support sharing xcscheme, "shared" is usually checked, so that the corresponding "***. xcscheme" will be moved to this directory.

Therefore, this directory should be put into svn for synchronization during development by many people. At the same time, note that the shared "***. xcscheme" will also affect teammates and should be modified with caution.

 

Note: After deleting this directory, re-opening the project will not be rebuilt. Be careful when deleting the directory ~

If you delete this directory and there is no xcscheme file in the "xcuserdata" folder, you can open the project and the compilation will fail;

If the following occurs, delete the "xcuserdata" folder and restart the project. Xcode will recreate the xcuserdata folder and the default xcscheme file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.