3

I have been using Info.plist in my projects, but recently I noticed that freshly generated new projects don't contain them anymore, and Info.plist is instead generated by Xcode at build time, from Info.plist Values section in target's Build settings.

I like this, as it would allow me to ship two projects (beta and non-beta one) from a same folder, without special build steps modifying the Info.plist for each project.

However, I noticed that:

  1. Many Info.plist keys are missing in Build settings (eg. ITSAppUsesNonExemptEncryption, or NSLocationAlwaysUsageDescription/NSLocationUsageDescription/NSLocationWhenInUseUsageDescription), so I cannot set them from there. There also doesn't appear to be any + sign when hovering, which would let me add another key into that section.

  2. And the way of adding INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; into a .pbxproj file, which I have found documented somewhere, no longer works.

Is there a way of adding additional keys into generated Info.plist? Or, is there a way of having both both Info.plist file in a filesystem, and Info.plist Values section in build settings, and make Xcode merge them during build?

Here is how the section looks like:

enter image description here

enter image description here

Tomáš Kafka
  • 4,405
  • 6
  • 39
  • 52
  • Does this help https://stackoverflow.com/questions/67896404/where-is-info-plist-in-xcode-13-missing-not-inside-project-navigator – Andrew Dec 07 '21 at 12:54
  • Since you didn't tag this [swiftui], I'll assume it's UIKit. Just created (in Xcode 13.1) two new projects - and yes, if it's SwiftUI you no longer have an info.plist file in the Project Explorer. BUT - if you create a "Storyboard" project (which is actually a UIKit project) you do get one. –  Dec 07 '21 at 19:22

1 Answers1

1

So, this was helpful (thank you Andrew!), but the core insight I got from experimenting is:

  1. Xcode doesn't want to let you enter invalid keys in places they don't belong.

  2. Build Settings only have basic properties, anything else belongs into the 'Info' section. Editing it will create a new Info.plist file with only the changed properties, which will then be merged with info.plist keys from build settings (I couldn't find a documentation for build order).

  3. Some settings, like ITSAppUsesNonExemptEncryption for standalone watch-only apps have no place to go. Apple mostly abandoned standalone watchapps, there is a ton of bugs around them and they don't care.

Tomáš Kafka
  • 4,405
  • 6
  • 39
  • 52