I have a project which can differ according to different environments, so the project is exactly the same, only some URL’s change. Normally I have my work environment where I access my dummy web services, and then when there is the need to starting using the client’s web services, I just want to rapidly switch those URL’s. To achieve that, my initial idea was to have different plist files according to each web services end points (the client can have multiple URL’s: pre production, testing, production). So:
-
Is this the best option I have? Have different plist for each web services endpoints? (again the project is exactly the same, only the endpoints are different)
-
Does it make sense to create a new target for each different
environment? Or am I able to do this in the schemes of the same
target?
According to how many parameters you need to change you could it with a macro, eg.
Then you can easily attach a compiler flag for the debug scheme in which you declare the macro without worries on having to different targets.
If your prefer to keep a .plist file you can easily use the same approach but change the file name instead that hardocidng the endpoint. But you’ll have both plists copied in the package unless using two targets (I guess it is possible even to conditionally include files in copying phase but not sure how to do it though)