Info.plist handling with Xcode 13

Since Xcode 13 when you create a SwiftUI app or your own app extensions from a template wizard you will get a project without an Info.plist listed in project navigator. Where is it gone?

“Projects created from several templates no longer require configuration files such as entitlements and Info.plist files. Configure common fields in the target’s Info tab, and build settings in the project editor.”

Xcode 13 release notes

That is nice but there is a problem when you want to generate your own Info.plist or want to have it versioned in a git repo. So in this article I will show how you can get Info.plist back.

Get Info.plist Back

1. Create a new “Property List” file (File → New → File):

Create your Info.plist file…

2. Name it Info.plist, then click “Create”:

Assign it to your App target

3. Because it just got created, Info.plist is still empty. We’ll need to transfer the exiting properties from “Custom iOS Target Properties” to here. So, let’s copy and paste them:

Individual row inside Custom iOS Target Properties copied
copy each property…
… then past

If you don’t want to copy and paste each property (there’s still no select-all feature), this gist has the default properties in XML format. To use them, right-click Info.plist → Open As → Source Code, then paste.

4. Copy the path of your new Info.plist from the Attributes Inspector to your Build Settings.

Go to: Project → Targets → Build Settings → Info.plist File

Then, paste in the path that you just copied:

5. Set Generate Info.plist File to “No”:

7. Finally you probably need to remove Info.plist from the list of “Copy Bundle Resources”.

tomkausch

Leave a Reply

Your email address will not be published. Required fields are marked *