Xcode:如何使用多个“显示名称"每个配置不同的值? [英] Xcode: How to use multiple "Display Name" values, different per each configuration?

查看:32
本文介绍了Xcode:如何使用多个“显示名称"每个配置不同的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Xcode 中,我们使用多个配置来编译多个不同的应用程序,具有不同的 Bundle ID 和显示名称.

In Xcode we use multiple configurations to compile several different apps, with different Bundle IDs and Display Names.

虽然身份 -> 捆绑标识符"正确显示了一个灰色的"只读值,但这与身份->显示名称"不同,导致所有配置的通用名称.

While the "Identity -> Bundle Identifier" correctly shows a greyed-out "" read-only value, this is not the same with the "Identity->Display Name", resulting to a common name for all configurations.

请注意,我们在每个配置的构建设置 -> 产品名称"属性上添加了不同的值,因为我们的 CFBundleDisplayName Info.plist 条目是 $(PRODUCT_NAME).

Note that we have added different values on the "Build Settings -> Product Name" property for each configuration, since our Info.plist entry for CFBundleDisplayName is $(PRODUCT_NAME).

我们尝试有一个空白的身份->显示名称",最初这有效(名称最终由配置的构建设置->产品名称"提供).

We tried to have a blank "Identity->Display Name" and initially this worked (the Name was eventually the one provided by the configuration's "Build Settings -> Product Name").

然而,在某些时候(当我们认为切换方案时)身份->显示名称"再次采用通用名称(用于.app文件名的名称),这导致所有不同的构建设置->产品名称"值将替换为相同的通用名称.

However, at some point (when switching Schemes we think) the "Identity->Display Name" took again a generic name (the one used for the .app filename) and this caused all the different "Build Settings -> Product Name" values to be replaced by this same generic name.

这是一个错误吗?我们应该怎么做才能使身份->显示名称"不可编辑,而是从配置值中获取其值(就像捆绑 ID 那样)?

Is this a bug? What should we do to NOT have the "Identity->Display Name" editable and rather get its value from the configuration values (like the Bundle ID does)?

注意:我们也尝试了此处提供的所有建议:Xcode 方案更改显示名称他们没有工作,请参阅答案下方的一些评论.

Note: We also tried all suggestions provided here: Xcode scheme change display name They did not work, see some comments below the answers there.

推荐答案

当我使用用户定义的设置作为显示名称时,它不会显示为 ,但是它确实从用户定义的设置中获取其值.您可以通过切换方案、清理然后从 General 选项卡切换,然后切换回 General 选项卡来看到它的变化.

When I'm using a user defined setting as the display name, it is not shown as <Multiple values>, however it does take its value from the user defined setting. You can see it changing by switching the scheme, cleaning and then switching from the General tab, and then switching back to the General tab.

这篇关于Xcode:如何使用多个“显示名称"每个配置不同的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆