Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change productName via xcconfig file in xcode?

I am setting below two parameters in Config.xcconfig file to fetch appDisplayName and bundle Identifier from config file. I did my code in xcconfig file as :

appDisplayName=myapp
appIdentifier=org.prince.myapp

Set in app-Info.plist file as

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

add it to project under configurations.

It is working fine as I have given myapp as display name it is showing in simulator/device as it is.

Lets come to the point. I want to know Is there any way to change PRODUCT_NAME variable value. I set PRODUCT_NAME=custom in configuration file but this doesn't seems to work.

enter image description here

like image 585
Prince Kumar Sharma Avatar asked Jun 27 '13 10:06

Prince Kumar Sharma


People also ask

What is Xcconfig file in Xcode?

A build configuration file is a text file with an . xcconfig filename extension that you add to your project. You can create as many build configuration files as you want, and you configure different settings in each one.

How to Set xcconfig xcode?

Creating and using your xcconfig file To create an xcconfig file, choose File -> New -> File... in your project. In the new file dialog, scroll down until you see the Configuration Settings File in the Other section. You can add configurations for pretty much anything you want.

How do I create a .xcconfig file on a Mac?

To create the XCCONFIG file, open the project you want to create the XCCONFIG file for, select File → New → File..., choose "Other" (under iOS and OS X), select "Configuration Settings File," name the file, choose the save location, and click Create.


1 Answers

O yes, I have done it...

set PRODUCT_NAME=kat in Config.xcconfig file and place PRODUCT_NAME variable on

->Targets --> Build Setting -->Packaging --> Product Name as given below in screenshot

enter image description here

like image 98
Prince Kumar Sharma Avatar answered Nov 05 '22 08:11

Prince Kumar Sharma