简体   繁体   中英

What is the difference between Bundle Identifier and Product Bundle Identifier?

I want to know the difference between the bundle Identifier (in info.plist ). And the Product Bundle Identifier (in the Build Setting -> Packaging -> Product Bundle Identifier ).

Thanks in advance .

BUNDLE IDENTIFIER is the namespace of your app, must be unique in the App Store world

PRODUCT_BUNDLE_IDENTIFIER is a variable in your project.pbxproj file. Apple says from the Xcode 7 release notes that PRODUCT_BUNDLE_IDENTIFIER is now "the recommended place to set the Bundle Identifier for a target." So if you're using BUNDLE_IDENTIFIER anyplace else in your project, you have to change it to PRODUCT_BUNDLE_IDENTIFIER to keep things in sync.

Bundle Identifier -

This is unique identifier for your application. Operating System uses this to uniquely identify your app. On App Store, every app has this as unique.

CFBundleIdentifier (String - iOS, OS X) uniquely identifies the bundle. Each distinct app or bundle on the system must have a unique bundle ID. The system uses this string to identify your app in many ways. For example, the preferences system uses this string to identify the app for which a given preference applies; Launch Services uses the bundle identifier to locate an app capable of opening a particular file, using the first app it finds with the given identifier; in iOS, the bundle identifier is used in validating the app's signature.

The bundle ID string must be a uniform type identifier (UTI) that contains only alphanumeric (AZ,az,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company's domain is Ajax.com and you create an app named Hello, you could assign the string com.Ajax.Hello as your app's bundle identifier.

Product Bundle Identifier -

This is a variable in Xcode Project File, form XCode 7.0 Apple recommends to set Product Bundle Identifier and then user $(PRODUCT_BUNDLE_IDENTIFIER) in CFBundleIdentifier in Info.plist

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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