Different Bundle Identifiers for iOS/macOS

Would it be possible to provide a different Bundle Identifier for an app depending on if it’s an iOS or macOS build?

I’m making an app that is the same across both platforms, but Apple requires that apps on the iOS App Store vs Mac App Store have different bundle identifiers. Right now the Projucer only lets you have one bundle identifier, which makes it a pain to use the projucer in any automated build setup.

1 Like

Yeah this would be a useful addition, I’ll add it to our backlog.

2 Likes

any chance this is added to a new Projucer version? And if yes, how can I do that?

I tried to use the Custom PList feature inside Xcode(iOS) export target of Projucer by writing this:

<plist>
  <dict>
    <key>CFBundleIdentifier</key>
    <string>com.mycompany.myproductios</string>
  </dict>
</plist>

It works (overrides the CFBundleIdentifier key inside the PList for the Standalone App and the AUv3 App Extension) but with some issues:

  1. it uses the same bundle id for both apps (standalone + AUv3) which is a problem. As I’ve read before here in the forum, if the Standalone app bundle id is com.mycompany.myproduct, the AUv3 app bundle id has to be com.mycompany.myproduct.myproductAUv3. This is handled perfectly from the Projucer, but not if you use the Custom PList.
  2. The bundle id is not been modified perfectly everywhere but I cannot specify where is the problem. I can confirm it though because if I look at the automatic provisioning profile that Xcode generates, it includes the bundle id that is specified in the general setting of my .jucer project and not the one i specify in the Custom PList, although the bundle id has changed in xcode’s info for target Standalone Plugin and AUv3 AppExtension.
1 Like

I would have the same kind of request here, it does not make sense to use different Projucer files for different Apple targets.

If it helps, my current solution is to set the bundle identifier in a pre-build script. This is less than ideal but it works for now. This seems like a very easy thing to add to the projucer though, I hope it is on their radar for the next release.

1 Like

I’ve added this to the develop branch here. You’ll need to rebuild the Projucer to see the change.

1 Like

Sorry for raising an old thread, but it seems that this does not affect defines like JucePlugin_CFBundleIdentifier, which is used in e.g. juce_mac_CoreMidi.mm for port ID generation (which is probably not a big deal), but more importantly can break user code that depends on this define.

I guess the solution is to enable global AppConfig header and manually define it there, am I right?

UPD: I was overthinking this - it turns out I can simply use Extra Preprocessor Definitions in Projucer to redefine JucePlugin_CFBundleIdentifier. Still, wouldn’t it be cleaner for Projucer to do it automatically using the Exporter Bundle Identifier value?