Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode bundle identifier formatting from {PRODUCT_NAME}

Assume I have an iPhone application whose Product Name is "My App" (with a space between words) in XCode build settings. In my info.plist, the Bundle identifier is specified as com.mycompany.${PRODUCT_NAME:rfc1034identifier}

In the resulting info.plist in the application bundle, the bundle identifier is shown as com.mycompany.My-App. I need it to be com.mycompany.MyApp. How do I change the Bundle Identifier setting so it would convert the product name the way I want?

ps. If I change the ${PRODUCT_NAME:rfc1034identifier} to ${PRODUCT_NAME:identifier}, the resulting bundle identifier will be com.mycompany.My_App. I just need to remove the space character in the product name completely in the result.

like image 519
ravinsp Avatar asked Feb 22 '10 09:02

ravinsp


People also ask

Can I change bundle identifier in Xcode?

Change the Bundle IDChoose your project from the left side, then your app target under TARGETS, select the General tab and rename the Bundle Identifier.

How do I change my product bundle identifier?

Under Targets > Build settings, scroll to Packaging. Change your Product name to the desired name & Product bundle identifier to the new one. Once you do this, automatically your project display name & bundle id changes to the new one in General tab.

Where is the bundle identifier Xcode?

Open you project with XCode, select the top project item in the project navigator at the left. Then select TARGETS -> General. Bundle Identifier is found under Identity.


1 Answers

Just type it in?

i.e. instead of com.mycompany.${PRODUCT_NAME:rfc1034identifier} just type com.mycompany.MyApp

If you have more than one target that need different bundle names, one way of doing it is to create your own variable and use that instead.

In the build menu (select your project and choose Get Info), you can add your own variables to the project. If you make one called MY_BUNDLE_NAME and set it to MyApp, you can then put com.mycompany.${MY_BUNDLE_NAME} in the plist file. You should be able to set MY_BUNDLE_NAME to different values for different targets.

like image 147
deanWombourne Avatar answered Oct 02 '22 04:10

deanWombourne