如何重新生成 iPhone Xcode info.plist 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1337403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:45:37  来源:igfitidea点击:

How to regenerate an iPhone Xcode info.plist file

iphonexcodeplist

提问by Atma

I have moved my iPhone app from one machine to another. In the process my info.plist file seems to have a bad bundle identifier and is not working. I want to create an entirely new info.plist file for my project.

我已将我的 iPhone 应用程序从一台机器移动到另一台机器。在此过程中,我的 info.plist 文件似乎有一个错误的包标识符并且无法正常工作。我想为我的项目创建一个全新的 info.plist 文件。

How can I do this?

我怎样才能做到这一点?

回答by Farcaller

Here's a clean info.plist for you. Don't forget to replace xxx.yyy, and rename xib file (if required)

这是一个干净的 info.plist 给你。不要忘记替换xxx.yyy,并重命名xib文件(如果需要)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string>Icon.png</string>
    <key>CFBundleIdentifier</key>
    <string>xxx.yyy.${PRODUCT_NAME:rfc1034identifier}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string>MainWindow</string>
</dict>
</plist>

回答by Kobski

If you just want an empty info.plist file, then just select "New File..." on the "File" menu in XCode.

如果你只想要一个空的 info.plist 文件,那么只需在 XCode 的“文件”菜单上选择“新建文件...”。

In the "New File" window you pick "Other" on the left hand and then "Property List" on the right hand.

在“新建文件”窗口中,您选择左侧的“其他”,然后选择右侧的“属性列表”。

回答by Marek R

I had problem finding "Info.plist" file too, especially that some C++ test application target doesn't have "Info" tab, so modification in this file had to be done manually.

我在查找“Info.plist”文件时也遇到了问题,尤其是某些 C++ 测试应用程序目标没有“Info”选项卡,因此必须手动修改此文件。

To find it:

要找到它:

  1. Select project in project navigator
  2. Select desired target (project can have multiple targets)
  3. Select tab "build Settings"
  4. Search for entry "Info.plist File". There you should find path of this file
  1. 在项目导航器中选择项目
  2. 选择所需的目标(项目可以有多个目标)
  3. 选择选项卡“构建设置”
  4. 搜索条目“Info.plist 文件”。在那里你应该找到这个文件的路径

Tested on Xcode 7.3.

在 Xcode 7.3 上测试。

In my case I had to "Allow Arbitrary Load" in "App Transport Security Settings" to restore insecure HTTP protocol.

就我而言,我必须在“应用程序传输安全设置”中“允许任意加载”以恢复不安全的 HTTP 协议。