What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist - iphone

Here is a good question:
Bundle Name, Executable Name, Product Name...anything else?
but I just wonder about the difference between "bundle display name" and "bundle name" in cocoa application's info plist.

I don't think any of the other answers concisely answers the question.
CFBundleDisplayName - displayed: below icon. According to docs, should be localized, but only if the app itself is localized, otherwise there will be some kind of penalty (if this is true in reality I cannot say)
CFBundleName - displayed: I have no idea. Docs suggest that it will be used in lists thus recommended max 16 characters, but for instance the Settings→General→Usage list of apps uses CFBundleDisplayName really. To date I have never figured out where exactly this one is used.
Oh, this is for iOS apps, can't speak for other OSes.

thanks for Wevah's answer. here is the descriptions for people who confused with this two constants.
CFBundleDisplayName
CFBundleDisplayName (String - iOS, Mac OS X) specifies the display name of the bundle. If you support localized names for your bundle, include this key in both your information property list file and in the InfoPlist.strings files of your language subdirectories. If you localize this key, you should also include a localized version of the CFBundleName key.
If you do not intend to localize your bundle, do not include this key in your Info.plist file. Inclusion of this key does not affect the display of the bundle name but does incur a performance penalty to search for localized versions of this key.
Before displaying a localized name for your bundle, the Finder compares the value of this key against the actual name of your bundle in the file system. If the two names match, the Finder proceeds to display the localized name from the appropriate InfoPlist.strings file of your bundle. If the names do not match, the Finder displays the file-system name.
For more information about display names in Mac OS X, see File System Overview.
CFBundleName
CFBundleName (String - iOS, Mac 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 application’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.

According to Apple,
Bundle display name :
The app name displayed on the iPhone home screen comes from the
CFBundleDisplayName (or "Bundle display name" as the human-readable
string in Xcode) entry of your iOS app’s Info.plist
Similarly, the app name you see in your WatchKit app's launch screen
and notifications comes from the CFBundleDisplayName of your WatchKit
app's Info.plist
Bundle name:
The Apple Watch app on the iPhone currently uses the bundle name (not
the bundle display name) of your iOS app, which is specified by the
CFBundleName (or "Bundle name") entry of its Info.plist
You can see other related screenshots and reach more info at Apple Developer page by clicking here.

From my experience:
CFBundleDisplayName is used in the grid of apps on iOS devices
CFBundleName is used in the list of apps stored in iTunes library

Only if Bundle Display Name (CFBundleDisplayName) is not specified, value of Bundle Name (CFBundleName) will be used to displayed under App Icon.
Please note that CFBundleDisplayName is localizable, and it should be used to set the App name shown in iOS Springboard menu & Mac OS X Applications / Mission Control.
In short, don't touch CFBundleName and leave its value as default, i.e. ${PRODUCT_NAME}.

Note that the bundle name is also used as prefix for HTTP user-agent.

CFBundleName is also used in system popups like approving web authentication services.

Related

How do I change the display name of an independant watchOS app?

I've tried changing the Display Name, the Bundle Name, and the Product Name but nothing seems to work. Every answer I've seen on here is referring to watch apps that have an iOS counterpart, not standalone independent watch apps.
This is done by changing the "Bundle display name" value in the Info.plist file in the WatchKit app folder.

how to set an apple watch app's display name

I can't seem to find where to set the product name of my apple watch app. I do see the option Product Name, but updating it doesn't do anything. Also do not see anything in the documentation
To get your app name to display properly in the Apple Watch app on iPhone, note that Apple screwed up and used the wrong key.
You must set CFBundleName to the same string as your CFBundleDisplayName in your iPhone target's Info.plist (not any other target).
That key can also be edited via the "Custom iOS Target Properties" editor. This is especially important if your app name has a space in it but your target name doesn't.
I wasted a whole Saturday tracking this bug down. So hopefully this will help someone!
First of all App's display name is different than Product Name.
How to change App's display name:
Find the Info.plist file that is located in your WatchKit App folder and change the key "Bundle display name" (CFBundleDisplayName).
How to change Product Name:
I am not sure why xCode does't allow to set the Product Name when creating a new WatchKit app.
If you search for "PRODUCT_NAME", you will find that the WatchKit app is using the TARGET_NAME as product name "PRODUCT_NAME = $(TARGET_NAME)" for the WatchKit app.
So you can just rename the target name.
Hope this helps.

Where CFBundleName is being used

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.
It's not well-documented, but CFBundleName is displayed to the user in the permission dialog displayed by ASWebAuthenticationSession.
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.

How do I localize my app's name in the App Store

I'd like to change the name of my app on the App Store for some of the localizations I handle.
I've already seen That I can change the name of the app on the springboard using CFBundleDisplayName and that works pretty well.
But there is nothing about the localization on the App Store.
Is CFBundleDisplayName doing the job ? Is there something else to do ?
Have you looked into iTunes Connect? I know that the description can be localized there (under Manage apps -> App -> Version -> Manage Localizations). I'm not entirely sure if it can be done though, as the names in the App Store have to be unique and therefore I imagine that are bound to a certain app ID.
To localize the App Name you can do this like any other file. First click on the AppName-Info.plist file then open up the Identity Inspector (Left Pane Column), under the document tag is a Localization section. You can just click the add button to add the different languages that you want (say, first English, then Italian). Than you just have to individual change each of the names in the AppName-Info.plist (English) and AppName-Info.plist (Italian) files.

How do you set the name of the iPhone app?

I have released and updated a few apps now, but this is still not very clear.
The app name as it appears on the app store is set from iTunes connect. Where do you set the name of the app as it appears on the phone once it is installed?
I have tried and succeeded in setting it in 'Product Name', but when Product Name has a space in it, the binary file name has a space too, which is not allowed when you upload the binary.
Clarity on this issue would be great.
Any help is appreciated.
You can just manually remove the space in the binary's filename before you upload it to iTunes Connect. It doesn't affect your app's name when installed on devices.
In the Info.plist file you can set the name that appears on the iPhone screen. The setting you need is called "Bundle display name" and it starts out set to ${PRODUCT_NAME}. Set it to whatever you like.
If you want to change the name according to the users language, create a file called InfoPlist.strings and localize it. I've made a Japanese localization (ja) for my app and the file contains one line:
CFBundleDisplayName = "東京アート";
This means that users with their locale set to Japan see that name, and other users see the one in Info.plist
If you Get Info on the Target, you can also set the "Product Name", which is the name you end up with after building (the actual file). You can set it with no spaces. You can also just remove the space before you zip and upload.