Where is Info.plist in Xcode 13? (missing, not inside project navigator)
Asked Answered
A

5

106

Has anyone figured out how to add/edit values in the Info.plist of Xcode 13 yet? I see they moved the Info.plist from the navigator pane... but although I can find it, I'm not sure how to edit it.

Amarette answered 9/6, 2021 at 1:40 Comment(0)
J
205

It's a "feature."

You don't need it anymore. From the Release Notes:

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. These files are added to the project when additional fields are used. (68254857)

So, instead of inside Info.plist, edit properties like NSCameraUsageDescription here:

Project -> Targets -> Info -> Custom iOS Target Properties

Options similar to those previously found in Info.plist

The first time you add/edit, Xcode will automatically generate a new Info.plist file that’s kind of synced1 with Custom iOS Target Properties. Xcode will later merge them for you.

[1]: They’re not fully synced. Some properties like NSCameraUsageDescription will only appear in Custom iOS Target Properties, while Application requires iPhone environment will appear in both. I have no idea how Xcode determines this.


Want Info.plist back, completely?

You might want all of your app's properties in one place. Or maybe you don't trust Xcode with the merging. I spoke with an Apple engineer at WWDC21 about this... here's how to get the classic Info.plist back.

  1. Create a new "Property List" file (File -> New -> File)

Property List option selected in new file popup

  1. Name it Info.plist

File will be saved in the same file hierarchy level as ContentView.swift

  1. Copy and paste the existing values from Project -> Targets -> Info -> Custom iOS Target Properties to Info.plist.
Copy Paste
Individual row inside Custom iOS Target Properties selected Row pasted into Info.plist

Note: Currently you can only select and copy 1 row at a time. If you want to save some time, here are the default contents in XML format. To use this, right-click Info.plist -> Open As -> Source Code, then paste.

  1. Copy the path to Info.plist in the attributes inspector.

Full path selected

  1. Paste the path here:
Project -> Targets -> Build Settings -> Info.plist File

Full path pasted

  1. Set Generate Info.plist File to No

Yes or No popup after selecting row

  1. Last step. Remove Info.plist from Copy Bundle Resources (select, then press the - button).
Project -> Targets -> Build Phases -> Copy Bundle Resources

Info.plist selected in Copy Bundle Resources

Yep, that was a lot. But whether you want classic Info.plist or not is up to you — both are fine and won't change your app.

Jargonize answered 9/6, 2021 at 2:8 Comment(11)
You probably mean minus button, not plus button.Averill
it makes absolutely no sense! The first time you add/edit, Xcode will automatically generate a new Info.plist file that’s kind of synced1 with Custom iOS Target Properties. Xcode will later merge them for you.Fredfreda
I've edited it and still no plist file!! What a mess Apple and Xcode has become in recent years!!Fredfreda
Beware - don't use absolute path for an Info.plist file, relative from project root is ok and won't break when building on another computer.Elvinelvina
Uhm, so in this new "plist". How do I add a new property? I don't see a plus on top EDIT: Got it. Press the plus on for instance the "Bundle name" and it worksRack
In Xcode 13.2.1 the Info.plist file already exists in the main target so I followed the steps from #6, although you still need to create those for test targets and remember not to assign target membership to the Info.plistCompatriot
a demonstration of finding the info tab: youtube.com/watch?v=mml9ZI81VKAThickness
My god, why must Apple take tried and true files and processes that we are used to and change them for no benefit whatsoever?Pyramidon
the broken link to release notes : developer.apple.com/documentation/xcode-release-notes/…Contrary
I just want to add NSCameraUsageDescription and don't see which + I need to do itTarpeia
@WilliamEntriken Right-click and click "Raw keys and values"Jargonize
M
31

It's a little tricky to discover how to add/edit values (using Xcode 14):

  1. Select your Target from the side panel
  2. Select the Info tab
  3. Hover over any item in the list to reveal the +/- buttons
  4. Click + button
  5. Select something from the options (it's a really long list)

[Update: adding an entry this way will ALSO create a plist file. It will simply be empty.]

enter image description here

Mitchmitchael answered 18/4, 2023 at 3:0 Comment(4)
I'm surprised this simple solution didn't get the most votes. It creates the Info.plist file automatically and everything!Frawley
This is the simplest and correct answerComplot
It seems that the new file is only created when you add a key that is not one of Apple's defaults. I had a set of values in from text that I was pasting in, and I had to add a dummy value to the list first to create the new file and then delete the dummy value in the new file to paste in my values as a source code editor.Natale
This is the way to go 👍Incense
B
3

Xcode 13.3.1, macOS Monterey(12.0.1)

Here is the most simple solution which work for both swiftUI and Storyboard projects, if you are not able to find info.plist and want to add target properties like Privacy - Camera Usage Description and things like we can add in older Xcode version. Here is the solution...


***> Select target of you project on top of the files click on Info on
> top of the right side, now you can see "Custom iOS properties" like
> info.plist, do whatever you want.***

Target > Info

see the image below for reference

enter image description here

Bicknell answered 14/6, 2022 at 9:17 Comment(0)
G
3

This also applies to Xcode 14. To be brief, a few pieces of information about this change:

  1. There is a good write up of the issue here: https://useyourloaf.com/blog/xcode-13-missing-info.plist/
  2. There is a good YouTube video (found in this page above): https://youtu.be/mml9ZI81VKA
  3. This issue applies to SwiftUI projects not Storyboard. Once you make a change to the "standard" info settings, Xcode actually automatically creates an info.plist file in your project navigator. You can then add more custom settings in the info.plist file.
Gurias answered 27/1, 2023 at 1:31 Comment(1)
I appreciate you pointing out item #3!Dignity
A
0

Here is a link to a raywenderlich tutorial: https://www.raywenderlich.com/19611194-multiplatform-app-tutorial-swiftui-and-xcode-12

The sample projects uses Xcode 12.0-compatible (objectVersion = 54) project format, created with the Multi Platform app template. I borrowed the plists from this project. Until the sample project is revised, it's nice to have a reference project (structure) for comparison.

Alroy answered 7/4, 2022 at 2:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.