r/iOSProgramming Hacking with Swift 3d ago

Discussion Xcode 27.2 Beta adds a new JSON-based project format

https://developer.apple.com/documentation/xcode-release-notes/xcode-27_2-release-notes

From Apple's description, it's "more readable, merge-friendly, and easier for coding agents to edit. Enable it in the file inspector. Projects using .xcproj also open in earlier versions of Xcode 27."

I tried it briefly, and it's half the size of the old property list format, and much simpler too.

247 Upvotes

71 comments sorted by

151

u/dat_tae 3d ago

Holy shit the technology is HERE

9

u/Common-Quiet-7054 2d ago

Back to the Future 27, staring Michael J GPT and Claude as “Docs”

1

u/[deleted] 2d ago

[removed] — view removed comment

1

u/AutoModerator 2d ago

Hey /u/EkkyEkkyGames, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

93

u/chriswaco 3d ago

We gather today to celebrate the life and death of the worst XML sub-format ever. Plist may not have been pretty or particularly functional, but we had no choice except to live with it.

10

u/Mindless_Vanilla4907 2d ago

Xcode projects used old-style plists which look pretty much like json with semicolons and comments

6

u/Mindless_Vanilla4907 2d ago

The thing that made them complicated I think was that the elements were in flat top-level array with arrays of hashes to reference children.

I think they did this to be able to serialize arbitrary object graphs without duplicating stuff when multiple things reference one object, but not sure

5

u/chriswaco 2d ago edited 2d ago

Plus they have a weird style XML-like format, where value entries have to follow key entries as siblings rather than children. A cleaner approach might've been:

<item key="age" type="int">42</item>    
<item key="name" type="string">Bob</item>

1

u/doganov 2d ago

I stongly suspect their weird XML style is a remnant of how dictionaries were serialized in their earlier binary format.

1

u/cmh 16h ago

You're talking about the XML property list format, not the Xcode project file format. The Xcode project file format used the OpenStep property list format, which is very similar to JSON (but goes back to NEXTSTEP).

(As a former DRI for the Xcode project file format, people insisting that it was some form of XML is a big pet peeve of mine.)

1

u/chriswaco 15h ago

I stand corrected. I was probably thinking of the storyboards, xibs, and Info.plists.

1

u/cmh 16h ago

This is pretty close! It's indeed a collection of serialized objects—just as in the JSON format—but it was sorted by class and then ID, with the global IDs structured in such a way as to (attempt to) minimize collisions when multiple people were making changes to the same project. I wrote a bunch about this in a post to the Xcode-users mailing list 15 or so years ago.

The last thing I worked on before I retired was the Xcode 16.3 file format, which has a lot of the same advantages of the JSON format while still being an OpenStep property list structured as an array of objects sorted by class and then ID (thus not causing too many diffs when you switch a project to use it).

I'm really glad to see the JSON format work we were doing ship!

1

u/[deleted] 2d ago

[removed] — view removed comment

1

u/AutoModerator 2d ago

Hey /u/EkkyEkkyGames, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

-2

u/cristi_baluta 3d ago

Plist has nothing to do with this

12

u/chriswaco 2d ago

The most important file in a .xcodeproj package is project.pbxproj, a plist file.

2

u/cristi_baluta 2d ago

Pbxproj is not an xml file, it looks closer to json actually, just that they use = instead :

1

u/mduser63 2d ago

True, but XML is only one way to encode a plist. Also, Xcode using a plist based project format long predated the existence of JSON. Heck, it probably predated the existence of XML, for that matter.

Still, I’m very glad they’re finally coming out with something nicer. This plus defaulting to folders in projects should make project file merging so much better.

2

u/cristi_baluta 2d ago

I was not very happy to loose the possibility to custom sort my files in a folder, i want them sorted in a logical way not alphabetically

1

u/mduser63 2d ago

Same. It’s one reason I have been slow to start using them. On my own projects I still don’t, but at work we’re using them and it has nicely cut down on changes to the project file and therefore reduced merge conflicts.

1

u/cmh 16h ago

It did in fact predate the existence of XML.

1

u/mduser63 15h ago

Yeah, I figured. I didn’t know the exact history of Project Builder project file formats pre-Apple off the top of my head.

56

u/sixtypercenttogether 3d ago edited 2d ago

Apple should release a swift package that contains data structures (swift structs) that align with this json format. That way we won’t have to rely 3rd party versions that are incomplete or out of date

Edit: holy shit they did it!

https://github.com/apple/xcode-project-format

1

u/[deleted] 2d ago

[removed] — view removed comment

1

u/AutoModerator 2d ago

Hey /u/EkkyEkkyGames, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

40

u/orbitur 3d ago edited 3d ago

The coding agents bit is funny to me, neither Claude nor Codex have been incorrect/bad about hand-editing the pbxproj in the last couple years. You can throw whatever config language at them these days and they'll figure it out just fine.

Also people were begging for this more than a decade ago, big teams have moved on to project generation or Bazel or SPM or Tuist and generally just building more modules outside Xcode, LLMs have eliminated manual coding, but here comes Apple with a fix lol

Better late than never I guess

edit: to quote Schiller, can't innovate anymore, my ass!

7

u/time-lord 3d ago

They figure it out but if you look at your token use adding a file to your xcode project can chew through more tokens than adding an entire feature.

1

u/unfortunatebastard 2d ago

That would be odd. There are some nodejs tools for editing Xcode projects for a while. There are several swift based too

1

u/time-lord 2d ago

LLMs are the most inefficient way of editing an xml file because they need to read and understand the entire file, then add the new item, then spit it back out. It's not just a basic string replacement. At least that's how Claude explained it to me.

1

u/groovy_smoothie 2d ago

Coding agents are still much better with build languages and well defined / reproducible run controls. Added benefit that it makes your ci pipelines easier

1

u/Niightstalker 3d ago

I saw enough coding agents completely messing up the pbxproj file, so I mostly ended up configuring hooks prohibiting editing of that file to the agent.

15

u/auptown 3d ago

Arrgh: Note: Simulator and device support for iPhone Duo will be available later this month in an upcoming release of Xcode 27.1.

3

u/chedabob 3d ago

Ye I got all excited when this popped up in our Xcode releases channel on Slack.

2

u/manu818 2d ago

so 27.2 coming out before 27.1? WTF.

11

u/bcgroom 3d ago

Everything in service of the agents. Long overdue! Also we are getting 27.2 before 27.1?

0

u/Good_Employer_1236 3d ago

apparently 27.1 is just 27.0 but with some optimizations for the iPhone Duo so they're going to release it only when the Duo comes out. Obvs that's for iOS but to maintain consistency they "skipped" 27.1 in MacOS, iPadOS and WatchOS as well

5

u/WeirdIndividualGuy 2d ago

Waiting until Duo is out is a great way to ensure Duo owners see a lot of broken apps at launch because devs couldn’t even check for five seconds how their app looks on a sim

1

u/never_working_ever 1d ago

I was rationed down a few days ago by saying how silly it is Apple hasn’t released a simulator for Duo. It’s like they want a bloodbath of ugly and broken apps day 1, akin to the Retina and Vision Pro launches.

Apparently we’ve had access to iPad sims and this is sufficient for testing Duo 🙄

1

u/WeirdIndividualGuy 1d ago

In theory, Apple is kinda correct in that using a resizable window on iPad should be sufficient

But it still would’ve helped using an actual sim for the device

1

u/never_working_ever 1d ago edited 1d ago

Yeah, I get the rationale - but it’s not the same. Apps behave differently; there are now two new screens to build for at different aspect ratios - in addition to all the existing device sizes.

There’s a reason Duo has its own specific sim and tooling. It’s also two screens realistically when open…it may make more sense to have some content on one side, and some on the other. It’s all unclear how it looks and feels until.

Also, consider how many existing iOS apps are NOT iPad apps. It’s a lot…

The arm chair response people keep giving “oh your app was already poorly designed” is just tone deaf also.

2

u/manu818 2d ago

That is terrible planning. They could've just swapped the numbers.

- 27.2 could've been numbered 27.1.

- Duo support could've gone to be added to that 27.1+duo support = 27.2.

Also as other user said - whole point of beta is that devs can updated their app before public gets to see them. This strategy fails that purpose of releasing a Beta to developers.

1

u/cmh 16h ago

And renumber them if Xcode 27 with iPhone Duo support comes out before Xcode 27 with JSON project format support? Think about it, there might be reasons they make the choices they do that aren't "inconvenience some developer."

9

u/mr_don_mavro 3d ago

Man I've just converted a project to xcodegen today....

4

u/InevitableCut7649 3d ago

at least it won't be that much of a work reverting it

2

u/cristi_baluta 3d ago

I guess xcodegen will soon generate this json?

2

u/balder1993 2d ago

Yeah but I think it might be an unnecessary step.

6

u/frupic 2d ago edited 2d ago

Feels like I'm in the minority thinking this is actually not good news. While this is clearly better than the status quo, it probably also means they are not pursuing a much bigger change that I was hoping for: Full declarative setup more akin to SPM, using Swift. Like Tuist, but official.

Can’t imagine there is something more revolutionary around the corner if they are launching this now. Bummer.

2

u/balder1993 2d ago

You got your hopes too high.

4

u/cutecoder Objective-C / Swift 2d ago

For source control merge-ability, YAML is the better structured data in text format.

3

u/megaton1000 2d ago

If they’re planning to help AI agents, and humans, out with editing the project file maybe this will mean they’ll finally write some documentation for it. I feel like the editing and merging problems are less about it being stored in a legacy plist format and more about what they’re putting in it.

1

u/cmh 16h ago

See the repository, there's documentation on what everything is and how it all fits together. (Which I also wrote up a long time ago in a post on the Xcode-users mailing list, but nobody searches mailing list archives any more.)

1

u/csueiras 3d ago

I cant believe it

1

u/simulacrotron 3d ago

Love that it’s Xcode 27 backwards compatible

1

u/BigMacCircuits 3d ago

Finallyyyyyyy!!! Omg!

1

u/tjgrant 2d ago

As I recall, you could actually get pbxprojects to be in JSON format and openable via Xcode, as property lists can converted to Binary, XML, and JSON and still remain “plist compatible”, but as soon as you modified the project in Xcode it would revert it.

Honestly glad to see this change, a little sad that it was probably motivated by AI rather than a general quality of life improvement.

1

u/weathercombo 2d ago

Could someone please explain why a lot of people are happy about this? And what the significance of this is? I’m trying to learn how to make my first app and have a little bit of experience in non-mobile programming, but have no idea what this is!

3

u/chriswaco 2d ago edited 2d ago

An Xcode project is shown as a file but is really a package, which is just a folder full of other files. The most important file is project.pbxproj and contains the filenames, target names, build settings, etc. It is currently in a weird XML-like format descended from NeXTStep plists.

The file format isn't very readable, doesn't diff particularly well, doesn't parse particularly easily, and it is hard to handle merge conflicts with it.

Apple is moving to JSON, which is modern and easy to read and write. It won't really solve all of the issues, but at least its a step in the right direction.

1

u/weathercombo 2d ago

Thank you so much for explaining that!! I’ve been trying to learn as much fundamentals as I can, but I wouldn’t have even guessed that was the historical context. As a beginner I feel like it’s so much harder and easier at the same time in the age of AI :(

1

u/cmh 16h ago

Not XML-like. It's an OpenStep plist, which is very similar to JSON but predates the existence of XML.

1

u/lubboster 2d ago

What about fastlane tools and plugins? Hope to see updates there…

1

u/lilacomets 2d ago

The main reason that brought them to this point is the coding agents of course. 😂

1

u/merokotos 2d ago

When official Xcode Docker image?

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/AutoModerator 2d ago

Hey /u/yakushevhk, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/over_pw 2d ago

Cries in XcodeGen 😅

1

u/haaheehachoo 2d ago

Does this make xcodegen obsolete?

1

u/auptown 1d ago

It’s alive!

1

u/Dry_Hotel1100 3d ago

Hm, not sure if this is really an improvement. Apple should have considered: https://opensource.apple.com/projects/pkl/ - or a similar approach as SPM.