iOS PRODUCT_NAME not the display and wrapper name - ios

For my iOS app I am trying to have multiple build configurations so I can create development and production builds that target different servers, configurations etc.
In Xcode I have created another build configuration and scheme to target this configuration. So I have the separate configuration/schemes as:
Dev version
PRODUCT_NAME=MyApp-dev
BUNDLE_IDENTIFIER=com.organisation.myapp-dev
Original Version
PRODUCT_NAME=MyApp
BUNDLE_IDENTIFIER=com.organisation.myapp
Both configurations can be built with the different schemes. Both will run on the same device because of the different identifier, but the dev version still shows MyApp on the home screen. When looking in the build products, it produces a MyApp.app bundle with a target inside it of MyApp-dev.
Is there another setting to change the wrapper name from MyApp.app to MyApp-dev.app? And any other setting that may be preventing PRODUCT_NAME setting to be used in the app display name?
edit: In the info.plist file, both the CFBundleName and CFBundleDisplayName are set to $(PRODUCT_NAME)
n.b. I have done this before with another app and all is working fine there, hence the query if another developer has changed a more targeted setting that overrides this change.

There was a InfoPlist.strings file in the project that was overriding CFBundleDisplayName. I removed this definition from this file and all worked as desired.
The project is not localised and so I never considered this override! Hopefully if someone else comes across this, remember settings in Info.plist can be overriden with localised strings in this file.

Related

App Store Connect issue ITMS-90129 keeps blocking upload

App Store Connect keeps blocking App upload by issuing
ITMS-90129: The bundle uses a bundle name or display name that is already taken.
So far I tried:
Changing the Display Name, Bundle Identifier (even with generated Hashcodes to make sure that the names really are not taken already)
Created alternative Profiles, Identifier and App in App Store Connect (also using the same mentioned hashcode)
Tried these changes in the Xcode input fields (under 'General') and also directly modifiyng the Info.Plist
Re-Exporting the project from Unity to XCode with the new naming (to make sure Unity is not writing some bundle id somewhere which is not visible in XCode)
(Update) Tried to Clean the build folder based on
minchaej suggestion
Additional information: The XCode project is exported from Unity and we're using Firebase which is installed via Pods.
I'm grateful for any hint where to continue looking - because I'm really running out of ideas. Thanks a lot for taking the time.
Cheers
vik
The solution for this (probably very Unity-to-XCode specific) issue was localization related:
I had to remove all but the English localization entry in the Localization section.
I'm not sure why there were other loca resources before (since we didn't set them up) but I assume these included an alternative app name which was causing the ITMS-90129 to pop up.
My salvation for ITMS-90129 is the next:
Remove definitions for
CFBundleName
CFBundleDisplayName
CFBundleSpokenName
for base(en) localisation InfoPlist.strings.
Setup this variables with single value $(PRODUCT_NAME) directly in Info.plist
Variable $(PRODUCT_NAME) define via root project Build Settings/Packaging/Product Name
Setup variable LSHasLocalizedDisplayName in YES value in Info.plist
Setup Russian (or other) localisation for variables
CFBundleName
CFBundleDisplayName
CFBundleSpokenName
via InfoPlist.strings
As I am personally assume, setup this variables via base localisation is the key of problems in which I am faced with

Dont see settings in xcode project

I'm doing an app and i try to have a setting that the user would be able to change from the iOS Settings page,
i opened a new settings.bundle in my app
and kept some of the default values, but i dont see it in my actual device settings
i tried reinstalling that app many tines, and i still dont see the app settings in my settings options on my iOS
here is my settings i created:
i kept the default values in the Root.plist
but also on the simulator and also on the actually device i dont see anything on the settings
what am i doing wrong ?
From the official docs at https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UserDefaults/Preferences/Preferences.html:
A Settings bundle has the name Settings.bundle and resides in the
top-level directory of your app’s bundle. This bundle contains one or
more Settings page files that describe the individual pages of
preferences. It may also include other support files needed to display
your preferences, such as images or localized strings. Table 4-2 lists
the contents of a typical Settings bundle.
So renaming your settings bundle to Settings.bundle should fix the problem.

Setup iOS icon from Qt

Because of this unsolved problem I have to assemble my Qt Creator projects to Xcode projects and run it there. So, I need to setup icon for iOS app version. I tried two ways:
1.
I can add icons and Info.plist inside ready Xcode project. It works pretty well, but I have no desire to do that every time I assemble Qt project to Xcode project.
2.
Thus, I tried to add icons and plist to pro-file:
ios {
ios_icon.files = $$files($$PWD/ios/AppIcon*.png)
QMAKE_BUNDLE_DATA += ios_icon
QMAKE_INFO_PLIST = ios/Info.plist
}
This way I get incorrect Xcode project. There is no Info.plist in the files of project tree, however I have references to that file (in the folder of Qt project, it's not copied) in Target -> Build Settings -> Packaging -> Info.plist file. App icons of different size are presented in Xcode project, but they are references, not copies. When trying to run, I get:
Installation failed. Invalid argument.
After coping icons and plist to that project, it runs well, but application title is ${PRODUCT_NAME}.
I also tried to setup copying of Info.plist in pro-file these ways, but got the same results.
Does anybody know what is going on here??
Open the Xcode bulid file and go to build Settings>product bundle identifier . Now set any bundle id in the field . Now run the project , it will automatically create info.plist file and other set up like standard .

Localization of CFBundleDisplayName doesn't work on device

I tried to make the localization of the app name using CFBundleDisplayName.
I made the localized InfoPlist.strings according two different language.
In one strings file wrote:
CFBundleDisplayName="x11111"
and in another:
CFBundleDisplayName="y22222"
And in file info.plist, I added "Application requires iPhone environment" property, and set the boolean value to YES.
And in info.plist,the "Bundle display name" I used "x11111".
The localization worked ok on the simulator, but when tested on the device , it did not work.
On device, the name I used for 'Bundle display name' in info.plist can only be showed.
By the way, I use cocos2d for the project.
Anything I missed or did wrong?
If your localisation files were supplied to you, and you need to add them, be sure to add them correctly on per file basis. In Xcode, while you are adding files, pay attention how you add them. This is how they should look in Xcode Project Navigator.
I have added them by selecting all folders which didn't add them correctly to project.

Change product name macro in iOS XCode project

I built my iPhone code atop Apple's sample project. It names the app "LazyTable" when placed on the home screen on iPhone. I would like to change this name. If I go to info.plist and manually type in a new name into the Bundle display name key, it works. But I don't want to hardcode because the PRODUCT_NAME is used in many places.
Info.plist
So I go into Project > Edit Project Settings to change the macro. I close the window, clean, and rebuild. The app name is still stuck with "LazyTable"! How do I make this change to the macro take effect?
Project Info
The approach you are using is correct. However, remember that each target can have their own settings that will override the project settings. Make sure the target does not override PRODUCT_NAME.
To do this, select the project in the Xcode project browser, then select the target. Each target has it's own build settings. Change the PRODUCT_NAME just as you would when editing the project build settings.

Resources