DEV Community

Cover image for Info.plist missing in XCode 13
Vadim Atamanenko
Vadim Atamanenko

Posted on

Info.plist missing in XCode 13

When you create a new SwiftUI project in Xcode 13, you may find that it does not have an Info.plist file. Why is this happening?

Image description

Xcode 13 Project Templates

First of all, this change only affects projects created in Xcode 13. If you open a project created in Xcode 12 or earlier with Xcode 13, this will not affect Info.plist.

Project Storyboard

Creating a new iOS project using Storyboard in Xcode 13 will also create an Info.plist:

Image description

If we click on info.plist to see the contents, you'll notice that this file is somewhat unusual:

Image description

It only has some default settings for the Application Scene Manifest where multi-windows are disabled. But where are the rest of the settings?

SwiftUI Project

The change will be more noticeable if you create a new SwiftUI project. You will notice that there will be no Info.plist file in the project navigator (or on disk) at all:

Image description

Also note that the SwiftUI template no longer uses the start screen storyboard.

What is going on here?

As far as I know, this was not mentioned at WWDC21 and the only documentation on this seems to be the Xcode 13 release notes.

Projects based on multiple templates no longer require configuration files such as permissions and Info.plist files. Set up common fields in the info tab of the target and create parameters in the project editor. These files are added to the project when using additional fields. (68254857)

The idea seems to be to create a complete Info.plist for the target at project build time, and create the project's Info.plist file only for changes you make other than the defaults.

Changing information settings

Some Xcode templates, such as the SwiftUI template, do not create an Info.plist in the source project. You can still make changes using the Info tab for target settings:

Image description

After the changes are made, Xcode adds an Info.plist file to the project and it appears in the project navigator. For example, if I add some App Transport Security options in the Info tab:

Image description

Xcode creates an Info.plist file containing just these App Transport settings:

Image description

We can then change the setting anywhere, and in theory Xcode keeps the two sets of settings in sync.

I say theoretically, because in practice problems can arise. For example, if I edit the Info settings in the project navigator, Xcode does not update the settings in the Info tab for the target to reflect the changes I made. I need to close and reopen the project for it to update. Let's hope this is a beta bug that will be fixed before the final release (FB9397345).

Build Settings

To add to the confusion, there are also some Info.plist settings that only show up in the build settings for the target. Basically these are the settings you change on the General tab for the target, such as supported orientations and launch screen:

Image description

You can change these options on the General tab, Info tab, or Build Settings (but they don't appear in the Info.plist file you see in the project navigator).

The Packaging section of the build settings allows you to disable Xcode's creation of the Info.plist file (more on this in a moment):

Image description

Backward compatibility

The Xcode 13 project format is not backward compatible with Xcode 12. If you create a project in Xcode 13, you cannot open it with Xcode 12. Apple mentions this in the release notes:

New projects created with Xcode 13 use the new version of the project. Using new projects with an older version of Xcode requires changing the project version in the file inspector, as well as manually migrating the configuration options for Info.plistand the permissions you can now specify in the target's build options. (77344653)

To make a project compatible with Xcode 12, change the project format in the Xcode File Inspector:

Image description

You also need to manually revert to the non-Xcode generated Info.plist file, otherwise you will lose your settings when you create the project with Xcode 12. Copying each setting manually from the Info tab is labor intensive. You may find it easier to start with the default Info.plist created in Xcode 12 and add any changes to it.

Finally, in Xcode 13, disable the creation of the Info.plist file in the build settings:

Image description

Top comments (0)