这是一个“功能”。
你不再需要它了。来自发行说明 https://developer.apple.com/documentation/xcode-release-notes/xcode-13-beta-release-notes:
从多个模板创建的项目不再需要配置文件,例如权利和 Info.plist 文件。在目标的“信息”选项卡中配置常用字段,并在项目编辑器中构建设置。当使用其他字段时,这些文件将添加到项目中。 (68254857)
所以,而不是在里面Info.plist
,编辑属性,例如NSCameraUsageDescription
here:
Project -> Targets -> Info -> Custom iOS Target Properties
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
完全回来了?
您可能希望将应用程序的所有属性集中在一处。或者也许您不信任 Xcode 进行合并。我在 WWDC21 上与一位 Apple 工程师讨论过这个问题……以下是如何获得经典的Info.plist
back.
- Create a new "Property List" file (File -> New -> File)
- Name it
Info.plist
- 复制并粘贴现有值
Project -> Targets -> Info -> Custom iOS Target Properties
to Info.plist
.
Copy |
Paste |
|
|
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 https://gist.github.com/aheze/fe11e259f78c4716897a599e01e593e2 in XML format. To use this, right-click Info.plist
-> Open As -> Source Code, then paste.
- 将路径复制到
Info.plist
在属性检查器中。
- 将路径粘贴到此处:
Project -> Targets -> Build Settings -> Info.plist File
- Set
Generate Info.plist File
to No
- Last step. Remove
Info.plist
from Copy Bundle Resources
(select, then press the - button).
Project -> Targets -> Build Phases -> Copy Bundle Resources
是的,那是很多。但无论你想要经典Info.plist
或不取决于你——两者都很好,不会改变你的应用程序。