Is it possible to change product name via xcconfig file in xcode?

I set below two parameters in the Config.xcconfig file to extract appDisplayName and bundle Identifier from the configuration file. I made my code in the xcconfig file as follows:

 appDisplayName=myapp appIdentifier=org.prince.myapp 

Set the info.plist in the app file as

 Bundle identifier = ${appIdentifier} Bundle display name =${appDisplayName} 

add it to the project under the configurations.

It works fine, as I gave myapp as the display name, which it shows in the simulator / device as it is.

Let's get down to business. I want to know if there is a way to change the value of the PRODUCT_NAME variable. I set PRODUCT_NAME=custom in the configuration file, but this does not seem to work.

enter image description here

+6
source share
2 answers

Oh yes, I did it ...

set PRODUCT_NAME = kat in the Config.xcconfig file and put the PRODUCT_NAME variable in

-> Goals โ†’ Build Settings โ†’ Packaging โ†’ Product Name as shown in the screenshot below

enter image description here

+1
source

See this image

Here you can edit the display name of the bundle, the name of the package. Double-click on $ [PRODUCT_NAME], then you can edit this.

If you want to change PRODUCT_NAME for Localization, then if you want to change the product name in another language according to the language of the device, you can localize the InfoPlist.strings file and add the following to all language files -

  "CFBundleDisplayName" = "Your_Product_Name"; "CFBundleName" = "Your_Product_Name"; 
-1
source

Source: https://habr.com/ru/post/948210/


All Articles