How to use two different GoogleService-info.plist file in ios swift project for dev n prod?
Asked Answered
O

1

9

I need to use two different GoogleService-info.plist for working with dev and prod builds, currently I'm separating dev and prod by just changing "build configuration" in edit scheme, but now I need to have two different .plist files for dev and prod for working with google analytics, pushwoosh etc,

Orelu answered 7/9, 2016 at 5:47 Comment(1)
Configure multiple projectsMunich
W
17

For this case you need use different Targets with diff bundle id in project for Dev and Prod.
After that you will can link GoogleService-info.plist for this targets. And also I recommend create different folders in project directory Look at pictures. The first you create targets Prod and Dev

enter image description here

After create diff folders in project dict let's call them GoogleProd and GoogleDev and copy your .plist file to diff folders and drag to project. First file you need link with TestProd target

enter image description here

And the second file link with TestDev target

enter image description here

The final project directory will look like

enter image description here

Wingo answered 7/9, 2016 at 5:49 Comment(6)
what do you mean by diff target ?? actually i'm new to xcode , there are 3 xcode provided target in my project like project-test and-uitest , so are you suggesting any of them ??Orelu
but my project is almost done more than 70 % , so now do i have to duplicate my current target ??Orelu
Yes you can. New target will have the same links to filesWingo
you are awesome , sorry for late response , your way to organise builds is working fabulously for me.Orelu
This needs to be handled by using different schemes on the same target, not two different targets.Efik
Thanks you for this answer, very clean helped me a lot !Katz

© 2022 - 2024 — McMap. All rights reserved.