Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Bundle Identifier instead of Product Bundle Identifier with Xcode 7

Tags:

xcode

ios

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?

like image 755
turingtested Avatar asked Oct 14 '15 10:10

turingtested


People also ask

How do I change my product bundle identifier?

Change the Bundle IDChoose your project from the left side, then your app target under TARGETS, select the General tab and rename the Bundle Identifier.

What is bundle identifier in Xcode?

When you create your Xcode project from a template, the bundle ID ( CFBundleIdentifier ), which uniquely identifies your app throughout the system, defaults to the organization ID appended to the app name that you enter in reverse-DNS format—for example, the bundle ID becomes com. example. mycompany. HelloWorld .


1 Answers

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.

From the Xcode 7.0 release notes:

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 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.

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

like image 91
Daniel Zhang Avatar answered Jan 01 '23 09:01

Daniel Zhang