简体   繁体   English

使用捆绑标识符而不是产品捆绑标识符与Xcode 7

[英]Use Bundle Identifier instead of Product Bundle Identifier with Xcode 7

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. 升级到Xcode 7后,我注意到CFBundleIdentifier已经开始指向Build Settings / Packaging中的Product Bundle Identifier,而不是Info.Plist中的Bundle Identifier。 Is there any way to change it back? 有什么方法可以改回来吗? Or will it simply work to point back to Bundle Identifier, ie write $(BUNDLE_IDENTIFIER) in the Product Bundle Identifier field? 或者它只是简单地指向Bundle Identifier,即在Product Bundle Identifier字段中写$(BUNDLE_IDENTIFIER)?

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 . 您应该在Info.plist中保留$(PRODUCT_BUNDLE_IDENTIFIER) ,并在Build Settings> Product Bundle Identifier中设置产品包标识符 ,其值类似于com.mydomain.myappname

From the Xcode 7.0 release notes: 从Xcode 7.0发行说明:

The new build setting Product Bundle Identifier (PRODUCT_BUNDLE_IDENTIFIER) is the recommended place to set the Bundle Identifier for a target. 新构建设置Product Bundle Identifier(PRODUCT_BUNDLE_IDENTIFIER)是为目标设置Bundle Identifier的推荐位置。 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. 应将目标的Info.plist配置为使用此构建设置,方法是在CFBundleIdentifier键的值中将其引用为$(PRODUCT_BUNDLE_IDENTIFIER)。

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. 当您接受问题导航器中的“升级到推荐设置”项目现代化时,Xcode会为您配置此项,除非您的目标预处理其Info.plist文件。 In that case you will need to configure this setting manually. 在这种情况下,您需要手动配置此设置。 This change is backwards-compatible to older versions of Xcode. 此更改与旧版Xcode向后兼容。

This change is required to make certain features work, such as On Demand Resources, if your target preprocesses its Info.plist file. 如果您的目标预处理其Info.plist文件,则需要进行此更改以使某些功能起作用,例如On Demand Resources。 (20887827) (20887827)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM