在Xcode 7中使用Bundle Identifier而不是Product Bundle Identifier [英] Use Bundle Identifier instead of Product Bundle Identifier with Xcode 7

查看:286
本文介绍了在Xcode 7中使用Bundle Identifier而不是Product Bundle Identifier的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到Xcode 7后,我注意到CFBundleIdentifier已开始指向在构建设置/打包"中找到的产品捆绑包标识符,而不是Info.Plist中的捆绑包标识符. 有什么办法可以改回来吗?还是返回指向捆绑包标识符,即在商品捆绑包标识符"字段中写入$(BUNDLE_IDENTIFIER)会简单地起作用?

After upgrading to Xcode 7 I have noticed that the CFBundleIdentifier has started to point to Product Bundle Identifier found in Build Settings/Packaging instead of the Bundle Identifier in the Info.Plist. Is there any way to change it back? Or will it simply work to point back to Bundle Identifier, i.e. write $(BUNDLE_IDENTIFIER) in the Product Bundle Identifier field?

推荐答案

您应将$(PRODUCT_BUNDLE_IDENTIFIER)保留在Info.plist中,并在 Build Settings>中设置产品包标识符.产品捆绑包标识符,其值类似于com.mydomain.myappname.

You should keep the $(PRODUCT_BUNDLE_IDENTIFIER) in your Info.plist and set your product bundle identifier in Build Settings > Product Bundle Identifier with a value of something like com.mydomain.myappname.

摘自Xcode 7.0发行说明:

From the Xcode 7.0 release notes:

新的构建设置产品捆绑包标识符(PRODUCT_BUNDLE_IDENTIFIER)是为目标设置捆绑包标识符的推荐位置.目标的Info.plist应该配置为使用此构建设置,方法是在CFBundleIdentifier键的值中将其引用为$(PRODUCT_BUNDLE_IDENTIFIER).

The new build setting Product Bundle Identifier (PRODUCT_BUNDLE_IDENTIFIER) is the recommended place to set the Bundle Identifier for a target. The target’s Info.plist should be configured to use this build setting by referencing it as $(PRODUCT_BUNDLE_IDENTIFIER) in the value for the CFBundleIdentifier key.

当您在问题导航器中接受升级到建议的设置"项目现代化时,Xcode会为您配置此项目,除非目标计算机对其Info.plist文件进行了预处理.在这种情况下,您将需要手动配置此设置.此更改与旧版本的Xcode向后兼容.

Xcode offers to configure this for you when you accept the "Upgrade to recommended settings" project modernization in the issue navigator, unless your target preprocesses its Info.plist file. In that case you will need to configure this setting manually. This change is backwards-compatible to older versions of Xcode.

如果目标对Info.plist文件进行了预处理,则必须进行此更改才能使某些功能(例如按需资源)正常工作. (20887827)

This change is required to make certain features work, such as On Demand Resources, if your target preprocesses its Info.plist file. (20887827)

这篇关于在Xcode 7中使用Bundle Identifier而不是Product Bundle Identifier的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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