Q:

How can I dynamically switch urls in dev/archive

I would like to be able to automate the process of swapping the app URL in AppDelate.m . However, I can't figure out how to do this. I would like to do this essentially:
if (schemeIsDebug) {
  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];    
} else {
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
}

This way when I hit archive it will automatically switch to the prod URL.

A:

#ifdef DEBUG
  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"]; 
#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif

This will switch jsCode in debug or release mode. And "archive" will always build in release mode.

