How to create a development / creation / production environment

I am trying to create an Xcode project that runs in a development environment (using a computer as a local host), an intermediate environment (a specific endpoint on the server), and a production environment (another specific server endpoint). I found several different tutorials on how to install this. Some solutions involve creating different goals; some suggest creating different configurations. What is the most efficient way to do this?

+4
source share
2 answers

Below are the steps for creating various schemes.

  • Choose a target
  • Create a new scheme and specify a specific name for the scheme (Dev, Staging, Prod, Debug)

enter image description here

URL- , :

1.

2.Go

3. URL-

0

1. Target , DEV/QA/PROD.

2. Environment.plist . Environment.plist : enter image description here

3. baseURL . :

NSURL* environmentsURL = [[NSBundle mainBundle] URLForResource:@"Environments" withExtension:@"plist"];
NSDictionary* environments = [NSDictionary dictionaryWithContentsOfURL:environmentsURL];
NSString* currentEnvironment = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"Environment"];
NSString* keyPath = [NSString stringWithFormat:@"%@.baseURL", currentEnvironment];
NSString *baseUrlString = [environments valueForKeyPath:keyPath];
0

All Articles