In an Xcode iOS .pbxproj file, how are the 12 byte ids generated?
Asked Answered
A

0

8

If you open up the .pbxproj file in a text editor, you'll see things that look like:

/* Begin PBXBuildFile section */
        25AF71181D2046B400566BC8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25AF71171D2046B400566BC8 /* AppDelegate.swift */; };
        25AF711A1D2046B400566BC8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25AF71191D2046B400566BC8 /* ViewController.swift */; };
        25AF711D1D2046B400566BC8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 25AF711B1D2046B400566BC8 /* Main.storyboard */; };
        25AF711F1D2046B400566BC8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 25AF711E1D2046B400566BC8 /* Assets.xcassets */; };
        25AF71221D2046B400566BC8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 25AF71201D2046B400566BC8 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

This article claims that they are UUID's, but if that was the case, shouldn't they be completely different from each other? If looks like only the 4th byte is changing and the rest stay the same. So is part of it generated and for some reason that byte changes? Why?

25 AF 71 **18** 1D 20 46 B4 00 56 6B C8
25 AF 71 **1A** 1D 20 46 B4 00 56 6B C8
25 AF 71 **1D** 1D 20 46 B4 00 56 6B C8

What does this UUID mean? Is it possible to replace the UUID from one that Xcode generated with your own? (And still work?)

Alvita answered 26/6, 2016 at 17:34 Comment(1)
Those IDs are actually just strings. You can replace them with any alpha numeric characters, or with any characters if the ID is wrapped in quotes. Sample output from my script that generated xcproj: "Application_cpp" /* Application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = "FILE_REFERENCE___Application_cpp" /* Application.cpp */; };Abie

© 2022 - 2024 — McMap. All rights reserved.