iPhone/Xcode: can different project targets have different bundle identifiers?

前端 未结 1 524
鱼传尺愫
鱼传尺愫 2020-12-24 08:32

I\'m a little confused how this works - this is my understanding:

  • A target\'s provisioning profile is linked to a specific app ID
  • The bundle identifie
相关标签:
1条回答
  • 2020-12-24 08:58

    There isn't a precedence, the properties dialog is just serving as another way for you to see your Info.plist.

    To share the plist between the targets but have different identifiers, make sure that the "Expand Build Settings in Info.plist File" option is enabled for both targets. Then, for each target, make a new user-created variable in the target settings for your bundle ID (e.g., APPLICATION_BUNDLE_IDENTIFIER, see here: https://stackoverflow.com/a/18472235/308315) and set it to the right value for that target. In your plist, put the following for bundle ID:

    <key>CFBundleIdentifier</key>
    <string>$(APPLICATION_BUNDLE_IDENTIFIER)</string>
    

    The variable will be evaluated at build time for each target, so each will get the right bundle ID.

    0 讨论(0)
提交回复
热议问题