Info.plist missing in XCode 13
Tags: xcode, swift, infoplist, descussion
Published: 2022-12-11 11:15:26

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejo2pnum1xifjnijl5h1.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/caeq9q0d6qd2bjaidcx6.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhhgeth4zubli2gpncjw.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gvhfgp5m4zhqsa7kntmg.png)

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 ](https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes) 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/agv9emrjwb1fw6goee4z.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lkrq77t35n58yiw8hegm.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zsl0wu6bydimywd02q1w.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fv6hyufzyffj2opol4k9.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg1rl5d6j8m2ijkr23py.png)

## 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.plist `and 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xw9ei1om5wkspzzc48xb.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9s1x2vin561z8m7ccmz.png)