43

I'm having a problem with bundle identifiers. In the Summary section of my project in Xcode and under 'Identifiers', I can't seem to change the name of my bundle ID as it is greyed out. For example, my project name is 'My App'. In the identifier text box in Summary, it says this 'My-App' and is greyed out. However, my bundle id in my provisioning profile is this, 'com.mycompany.myapp'. I would like to change my bundle ID in my project to that but I can't seem to be able to. Any ideas why it is greyed out? Thanks!

Richard Slater
  • 6,313
  • 4
  • 53
  • 81
Moo33
  • 1,251
  • 3
  • 15
  • 27

9 Answers9

82

If anybody else runs into this, it is likely because you have a product name variable, something like .${PRODUCT_NAME:rfc1034identifier}, appended to the end of your bundle identifier under Target (your application) > Info (info.plist). Try removing that.

Alex Ross
  • 3,729
  • 3
  • 26
  • 26
54

Not sure why this is happening to you, but try to change in the info.plist file.

ashokbabuy
  • 1,000
  • 10
  • 17
  • 2
    it's greyed out because it's referring to a variable in the info.plist file. but yeah, change it in info.plist and get rid of that funky variable. – Shai UI Jan 03 '15 at 04:49
9
  1. Go to info.plist file
  2. Go to Bundle Identifier key-value pair
  3. Remove .${PRODUCT_NAME:rfc1034identifier} from the value and save the file

Your bundle identifier has been modified as required.

aksh1t
  • 5,410
  • 1
  • 37
  • 55
Kunal Khanna
  • 551
  • 6
  • 6
  • 2
    You really want to actively save the .plist and immediately close and open Xcode. If you don't, and click on Target>Info after you changes, then somehow the problem is re-introduced. – Sjakelien Jan 22 '15 at 09:08
  • 1
    @Sjakelien if you just build the app it works as well – Fabio May 10 '15 at 14:39
6

If you want to edit the Product Name, rather than remove it; you can set it in your target, using the following steps:

  • Open the Target in XCode
  • Go to the Build Settings tab
  • Scroll down to Packaging->Product Name

The name set in Product Name is added to the Bundle Identifier (spaces are changed to dashes e.g "Test App" becomes "Test-App").

HaemEternal
  • 2,229
  • 6
  • 31
  • 50
5

You may want to consider changing the value of PRODUCT_NAME instead of directly changing the bundle identifier. This can be done thru the XCODE interface (and should have the added benefit of not possibly causing problems with certificates and code signing later on...which can be a real bear to resolve):

Click here to see stackoverflow thread for detailed instructions on how to do this thru XCode interface

Community
  • 1
  • 1
Questor
  • 376
  • 4
  • 8
4

With Xcode 14.x

  • Just press the arrow beside the bundle identifier field, it will jump to Signing & Capabilities, here you can edit bundle id.

Steps:

  • Select Project and then click Target
  • Under General scroll to Identity section
  • Click arrow beside bundle id
  • Edit the bundle id (it will be reflected in Identity section)

enter image description here

Saif
  • 2,678
  • 2
  • 22
  • 38
0

It may be that it's set in a .xcconfig file instead. For example, one Parse sample project has a 'debug.xcconfig' with:

BUNDLE_IDENTIFIER = com.parse.Anypic

If so, this is the place to change it.

Graham Perks
  • 23,007
  • 8
  • 61
  • 83
0

I saw this also happen when the iOS Deployment Target is higher than your version of Xcode supports. Between World Wide Developers Christmas when they release the betas and when the new version is finalized.

So say you have a project with a min deployment for the current iOS beta version, but you are using the release version of Xcode. Just open the project in the current Xcode beta version.

uɥƃnɐʌuop
  • 14,022
  • 5
  • 58
  • 61
-2

This can also be related to user defined variables under [Target] > Build Settings > User-Defined