From this old question: What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist
It points to the official docs, which say:
CFBundleName
CFBundleName (String - iOS, OS X) identifies the short name of the
bundle. This name should be less than 16 characters long and be
suitable for displaying in the menu bar and the app’s Info window. You
can include this key in the InfoPlist.strings file of an appropriate
.lproj subdirectory to provide localized values for it. If you
localize this key, you should also include the key
“CFBundleDisplayName.”
Can anyone tell how to show this name in iOS?
I was never able to show this value in my iPhone.
It doesn't look to me like CFBundleName
shows anywhere to the user, on iOS. I believe I've seen documentation for Mac OS X (which obviously iOS inherits a lot of legacy infrastructure from), that says that the Bundle Name is used for something else ... I think it might have been the name in the upper Menu bar, or the lower Dock bar. Neither thing exists in iOS, of course.
I also found this Stack Overflow answer, which is now quite old (but with quite a few upvotes). This answer claims that CFBundleName would be the name of the folder that the app is stored in. So, for example, CFBundleName = HelloWorld
should produce
+- HelloWorld.app
- HelloWorldApplication
If the Executable Name was set to be HelloWorldApplication
. However, I just built a simple program and ran it on iOS 5.0, and the .app folder was not named equal to CFBundleName
. So, if it ever worked that way, it doesn't seem to any more.
I have seen quite a few references that say that CFBundleName
should be left set to ${PRODUCT_NAME}
in Xcode, which is what I always do. Not as a technical limitation, but as an Apple review criterion, I've also seen people claim that CFBundleDisplayName
must be closely related to CFBundleName
. For example, it's ok if it's a shortened version of CFBundleName
, but that they might reject the app if it's unrelated altogether.
I also checked the listing in Settings.app, and in iTunes, and I didn't see the Bundle Name either of those places.
So, to answer your question, I don't believe this variable is visible to the user (on iOS).
Update: I have not, however, checked whether or not any accessibility features might speak this name anywhere.
Also, this SO answer claims that CFBundleName
will be the name used in the iTunes App Store URL for your app. But, see @tc.'s comment/example URL below ...
Update 2: per @honus's comment below, one unusual scenario where CFBundleName
can be shown to the user is if your app has no entry for CFBundleDisplayName
in its Info.plist file. In that case, CFBundleName
will be shown under the app icon in SpringBoard.
You can access those keys like this.
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]
Where infoDicitonary
is A dictionary, constructed from the bundle's Info.plist file
. There you can find this sort of information about your App. NSBundle
Note: You can check the actual key by opening the App-info.plist
file and right clicking anywhere then selecting the option Show Raw Keys/Values
.
CFBundleName IS used, when localizing a MacOS Cocoa App, in the Mac OS MenuBar as the Application Name (right from the File Menu).
So it DEFINITELY has a meaning.
Don't know, if it is used and shown somewhere else. But better not leave it out, when localizing your app!
On macOS it is used as a means to decide if the application's name should be localized in the Finder. If the actual name of the bundle (of course extended by '.app') matches CFBundleName
, Finder will show its localized display name instead. However, a user might rename the App to something he finds more appropriate and in that case, macOS needs a way to tell if the name was customized.
If you open your info.plist file by context clicking it in the project tree and selecting "Open As > Source Code", you'll see the XML representation of the plist. By default, these two keys have the same value, so you could access either one.
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
To actually grab the values, you can use this SO post as a guideline: How to display the current project version of my App to the user? Just replace the CFBundleVersion
key with CFBundleDisplayName
.
In essence:
NSString *displayName = [[[NSBundle mainBundle] infoDictionary]
valueForKey:@"CFBundleDisplayName"];
Bundle name is the name of the actual application bundle on the file system.
Bundle display name is the caption of the application icon that the user will see on either their iOS device or the caption of the icon on OSX.