Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change product name macro in iOS XCode project

Tags:

xcode

ios

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

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

project info

like image 963
JoJo Avatar asked Aug 10 '11 19:08

JoJo


People also ask

Where is product name in Xcode?

Choose your app from the TARGETS, go to Build Settings and search the word plist. Under the Packaging section, you'll find the Info.

How do I change my target name in Xcode?

Rename the Target to Rename the App Select the project from the project navigator to open the project editor and see a list of the app's targets. To rename a target, select it, press the Return key, and enter the new name. If all you want to do is rename the app, you're finished.

Where is PRODUCT_NAME defined in Xcode?

The PRODUCT_NAME is defined in the target's Build Settings in the Packaging section. It has the same name by default as your project. Edit: While PRODUCT_NAME is by default the name of the Target ( MyDemoApp in this case).


1 Answers

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.

like image 77
memmons Avatar answered Nov 15 '22 06:11

memmons