xcode 捆绑 ID 是否区分大小写?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7688379/
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 22:05:08  来源:igfitidea点击:

Is bundle id case sensitive?

iosxcodeapp-storexcode4cfbundleidentifier

提问by sarunw

In a provisioning profile I set my app id to com.mycompany.lowercaseappname, but in Xcode 4 the bundle identifier is auto configured to use my ${PRODUCT_NAME}, which is capitalized (I want the user to see it capitalized under the app icon). Is this ok or do I need to change the bundle id manually in Xcode to lower case?

在配置文件中,我将我的应用程序 id 设置为com.mycompany.lowercaseappname,但在 Xcode 4 中,捆绑标识符自动配置为使用我的${PRODUCT_NAME}大写字母(我希望用户在应用程序图标下看到它大写)。这可以吗,还是我需要在 Xcode 中手动将 bundle id 更改为小写?

回答by nevan king

The bundle ID is case sensitive. From the Apple Docs:

捆绑 ID 区分大小写。来自苹果文档

However, unlike domain names, bundle IDs are case sensitive. If the App ID is lowercase, your bundle ID needs to be lowercase, too.

但是,与域名不同,捆绑 ID 区分大小写。如果 App ID 是小写的,你的 bundle ID 也需要是小写的。

Note that the bundle ID is not what the user will see as the app name. That's the "Bundle Display Name"

请注意,捆绑 ID 不是用户将看到的应用程序名称。那是“捆绑显示名称”

回答by user984596

The bundle identifier must be globally unique (not match any other application in the world) but it doesn't have to match the application name, nor is the case important. However, remember that the preferences file will be named the same as the identifier so the identifier should be recognizable to the user as belonging to your application.

包标识符必须是全局唯一的(不匹配世界上的任何其他应用程序)但它不必匹配应用程序名称,大小写也不重要。但是,请记住,首选项文件将与标识符命名为相同的名称,因此该标识符应该可以被用户识别为属于您的应用程序。

You can override the auto-configured bundle identifier in Xcode4 by pressing Command-1 to see the navigator view, clicking on the xxx-Info.plist file (where xxx is your application name) and changing the Bundle Identifier string to anything you want. It doesn't have to contain the ${PRODUCT_NAME:rfc1034identifier} variable.

您可以通过按 Command-1 查看导航器视图,单击 xxx-Info.plist 文件(其中 xxx 是您的应用程序名称)并将 Bundle Identifier 字符串更改为您想要的任何内容来覆盖 Xcode4 中自动配置的包标识符。它不必包含 ${PRODUCT_NAME:rfc1034identifier} 变量。