Xcode 6: how to set a custom bundle identifier?
Asked Answered
R

2

6

In Xcode 6, I need to set a custom bundle identifier for my app store target.

I'm trying this:

  1. I tap my project in Xcode upper left.

  2. I see the project settings center pane, "General" tab, "Identity" section.

  3. I see the "Bundle Identifier" field and I click to edit it.

  4. The text changes to a mix of black editable text and gray uneditable text.

How do I edit the bundle identifier?

Riordan answered 23/1, 2015 at 21:25 Comment(0)
R
25

(Found the answer - posting here to help others, and if people have comments)

The Xcode default autogenerates the bundle identifier based on the product name.

To edit a target's bundle identifier:

  1. Tap the icon "Show projects and targets list" in project settings center pane upper left.

  2. Tap the target.

  3. Tap the "Info" tab, and open the "Custom iOS Target Properties" drop arrow.

  4. You see the Key "Bundle Name" set as "$(PRODUCT_NAME)", and the Key "Bundle identifer" set as "com.example.$(PRODUCT_NAME:rfc1034identifier)". Edit these as you wish. Then choose the "Product > Clean" menu item.

enter image description here

Riordan answered 23/1, 2015 at 21:26 Comment(0)
E
3

i think it may be possible to set a custom bundle identifier (and change bundle display name and bundle name) without modifying ${PRODUCT_NAME:rfc1034identifier} (i read in stackoverflow that changing this could cause issues down the road when building for distribution).

to change product name setting: select target / build settings / (packaging) product name

xcodeScreenShot

Enzymology answered 25/7, 2015 at 3:16 Comment(1)
Thanks for the answer and screenshot. I'll try your way in my next app. In my current app, the bundle name and id are different than the product name. For example, the product name is "Foo", the bundle name is "Bar", and the id is "com.example.bar" (lowercase "bar" instead of capitalized "bar").Riordan

© 2022 - 2024 — McMap. All rights reserved.