【问题标题】:Can the name of the bundle application be different of the name of the executable file?捆绑应用程序的名称可以与可执行文件的名称不同吗?
【发布时间】:2013-12-03 06:49:11
【问题描述】:

我有一个沙盒登录项,其可执行文件名类似于 X174423.MyApp,因为它以我的开发人员 ID 为前缀。我想将此帮助应用程序的捆绑包名称设置为 MyApp。

在 Xcode 5 中,我尝试更改包的显示名称,但包的名称没有改变。

我在 InfoPlist.strings 中创建了一个 CFBundleDisplayName 条目,但捆绑的名称提醒了相同的内容。

我好像错过了什么,但是什么?

【问题讨论】:

    标签: cocoa xcode5 appstore-sandbox


    【解决方案1】:

    如果我理解正确,您希望捆绑包在 Finder 中显示为 MyApp。我不知道为什么它必须是这样的,但它以下列方式为我们工作。在您的 Apps Info.plist 中:

      <key>CFBundleDisplayName</key>
      <string>X174423.MyApp</string>
      <key>CFBundleName</key>
      <string>X174423.MyApp</string>
    

    并在 InfoPlist.strings 中遵循:

      /* Localized versions of Info.plist keys */
       CFBundleDisplayName = "MyApp";
       CFBundleName = "MyApp";
    

    或者你可以在 Info.plist 中尝试这个并且不要使用 InfoPlist.strings:

      <key>CFBundleExecutable</key>
      <string>X174423.MyApp</string>
      <key>CFBundleDisplayName</key>
      <string>MyApp</string>
      <key>CFBundleName</key>
      <string>MyApp</string>
    

    【讨论】:

    • Apple 说:登录项的文件名必须与其捆绑标识符匹配。具有捆绑标识符“XYZABC1234.com.example.iDecideHelper”的登录项将具有“XYZABC1234.com.example.iDecideHelper.app”的文件名。我希望位于主应用程序包中的帮助程序包的名称不以我的开发人员 ID 为前缀。但可执行文件会。我已经尝试过您提供的解决方案(谢谢),但帮助程序包的名称永远不会改变,它始终是包标识符的名称。 Xcode 5 下的沙盒应用程序(主程序和辅助程序)就是这种情况。
    猜你喜欢
    • 2011-03-27
    • 1970-01-01
    • 2012-10-29
    • 2014-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多