121

Where can I find information on how to modify these

  • ${EXECUTABLE_NAME}
  • ${PRODUCT_NAME}

These are only displayed in .plist file but where are the actual values.

If we can directly modify what ever we want in .plist why we need these.

I am new that's why I'm having problem understanding these, I also looked into apple information Property list key reference but didn't find these ${} values.

Stu P.
  • 1,365
  • 1
  • 14
  • 31
Hazel Sophie
  • 1,345
  • 2
  • 9
  • 8
  • It's worth noting that you can change these values through command line tools if you use an [xcconfig](https://nshipster.com/xcconfig/). ie you set them to whatever you want and then archive and release a build – mfaani May 28 '20 at 16:43

4 Answers4

197

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.

screenshot

Edit:

While PRODUCT_NAME is by default the name of the Target (MyDemoApp in this case). The EXECUTABLE_NAME is a concatenation of:

$EXECUTABLE_PREFIX, $PRODUCT_NAME and $EXECUTABLE_SUFFIX.

See the reference of EXECUTABLE_NAME for details.

Update

The new reference can be found here http://help.apple.com/xcode/mac/8.3/#/itcaec37c2a6

EXECUTABLE_NAME
Specifies the name of the binary the target produces.

Besi
  • 22,579
  • 24
  • 131
  • 223
  • Opps, my `Product Name`'s default value is `$(TARGET_NAME)`, though it is equal to my project name.. – Kjuly Jul 21 '12 at 13:33
  • 16
    So where is the $(TARGET_NAME) stored? – user4951 Sep 24 '12 at 06:46
  • 2
    @Jim Thio: This is the name on your Target which you can change by clicking on the target in the view above. By default the target has the same name as the project so in my example the name of the target is "MyDemoApp" too. – Besi Dec 04 '12 at 08:29
  • @Besi can we access buildSettings file to make some changes manually when project is not opened in xcode like build.xml in android – Prince Kumar Sharma Jun 19 '13 at 12:01
  • @Hercules Have a look at your `-Info.plist` file, some of the values are defined in there and can therefore be changed without opening Xcode – Besi Jun 19 '13 at 15:35
  • Where do you see that `EXECUTABLE_NAME` is a concatenation of: `$EXECUTABLE_PREFIX`, `$PRODUCT_NAME` and `$EXECUTABLE_SUFFIX`? – CyberMew Aug 06 '20 at 06:55
2

I think the $ represents the variable productName & executableName as the $ is used in unix. The variables are set in the build setting of the application. So you should not change the product name directly in the plist file. Instead, go to build settings, search for product name and change it.

utsabiem
  • 920
  • 4
  • 10
  • 21
  • 1
    in build settings i am able to see only product name other executable variable is not there – Hazel Sophie Jan 04 '12 at 07:20
  • It's worth noting that you can change these values through command line tools if you use an [xcconfig](https://nshipster.com/xcconfig/). ie you set them to whatever you want and then archive and release a build – mfaani May 28 '20 at 16:43
1

Xcode ${<variable_name>} syntax

Xcode variable can be defined on different level and the Resolved one is used. You can use Build Settings -> Levels tab to manage it

enter image description here

All variables are listen in Build Settings. Also every setting has it's own declaration

Product Name - PRODUCT_NAME

These setting are saved in buildSettings block of

<project_name>.xcodeproj/project.pbxproj

You can use Search view to find any variable and Help Inspector to find declaration and other useful information

Some of settings are not exposed by Xcode

EXECUTABLE_NAME

But you are able to get or even to override the value using User-Defined Settings

reader_EXECUTABLE_NAME = $(EXECUTABLE_NAME)
EXECUTABLE_NAME = $EXECUTABLE_PREFIX$PRODUCT_NAME$EXECUTABLE_SUFFIX

[SWIFT_MODULE_NAME, PRODUCT_MODULE_NAME, PRODUCT_NAME, EXECUTABLE_NAME]

[TARGET_NAME]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
1

Specifically about how ${PRODUCT_NAME} gets defined in terms of order:

  1. It's originally defaulted to the target's name: $(TARGET_NAME)
  2. You can reset it in 'build settings' by searching for Product Name

Note: If any value was derived off of ${PRODUCTS_NAME} and you change it to some-constant-value then it's no longer going to be a computed value.

e.g. if you change the value of CFBundleName from its default ${PRODUCT_NAME} to something like My cool App then your app's name on the springboard will show up as 'My cool App'. It will no longer show up as 'whatever your target's name is'

mfaani
  • 33,269
  • 19
  • 164
  • 293