Use different GoogleService-Info.plist for different build schemes

后端 未结 17 741
梦毁少年i
梦毁少年i 2020-12-07 07:49

I am using a build scheme for prod and one for staging (with 2 different bundle identifiers) and I am trying to use a separate GoogleService-Info.plist for each scheme. Is t

17条回答
  •  借酒劲吻你
    2020-12-07 08:44

    This answer is very much inspired by @abbood's answer, but a bit more specific on how to do it.

    For each of your targets, e.g. dev, stg, prod:

    • Download the corresponding GoogleService-Info.plist to a separate folder named after your target
    • In Xcode, right-click your app folder and choose Add files to "your app"
    • Select the folder containing the target's GoogleService-Info.plist, make sure Copy items if needed and Create groups are selected, check only the corresponding target in the list of targets, and press Add

    That's it. Now you should have something similar to this structure

    When you build a target, the correct GoogleService-Info.plist will be used.

提交回复
热议问题