Reordering Xcode’s Products Group

In my last post I alluded to the problem of Xcode showing multiple products with the same name without differentiation in the UI:

Screenshot of Xcode project navigator with unorganized product items.

It’s bad enough to have two items there with exactly the same description, but it’s particularly annoying (especially when the products list is quite long) that the ordering of items in this section apparently cannot be customized at all.

If memory serves correctly, the Products folder used to just be an ordinary group in Xcode, where you might happen to organize your “product items.” It’s only recently that Apple has barred reordering of the items in the group.

It occurred to me that I could probably hand-edit the project.pbxproj file inside the Xcode project. Sure enough, rearranging the lines of the file such that the “children” of the “Products” PBXGroup item are in the desired order does the trick.

However, I won’t be hand-editing Xcode project files for this purpose anytime soon, because If found another glitch in Xcode that makes it even simpler. Just rename the “Products” group to anything but Products, then rearrange at will:

Screenshot of the products group with contents reorganized

Change the name back to “Products” when you’re done, and you’re done.