I have a react-native app (iOS only for now) - and coming from a JS background and not being familiar with XCode, I am finding that documentation on creating production builds for iOS is very sparse. According to the one vague sentence on https://facebook.github.io/react-native/docs/running-on-device-ios.html :
The JS bundle will be built for dev or prod depending on your app's scheme (Debug = development build with warnings, Release = minified prod build with perf optimizations). To change the scheme navigate to Product > Scheme > Edit Scheme... in xcode and change Build Configuration between Debug and Release.
However, in XCode v7.3 this is what I see when I click Product > Scheme > Edit Scheme (no option to "change Build Configuration between Debug and Release") :
I understand how to run on the phone locally, and the difference between running on the simulator vs. phone. It works fine on the simulator and on plugged in phone.
Now when I archive the app, save for ad hoc distribution, upload to TestFairy, download on my phone, and run it - I often see things like the Yellowbox warning:
Also suspicious crashes like this (recorded by TestFairy):
Application Specific Information:
*** Terminating app due to uncaught exception 'RCTFatalException: Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
URL: http://192.168.0.21:8081/index.ios.bundle?platform=ios', reason: 'Could not connect to development server.
Ensure the following:
- Node serv...'
Last Exception Backtrace:
0 CoreFoundation 0x22939b8b __exceptionPreprocess (in CoreFoundation) + 127
1 libobjc.A.dylib 0x220f6dff objc_exception_throw (in libobjc.A.dylib) + 39
2 CoreFoundation 0x22939ad1 -[NSException initWithCoder:] (in CoreFoundation) + 1
3 myapp 0x000b1ad5 0x98000 + 105173
4 myapp 0x000cb01f 0x98000 + 208927
5 myapp 0x000c9149 0x98000 + 201033
6 libdispatch.dylib 0x224cbcbf _dispatch_call_block_and_release (in libdispatch.dylib) + 11
7 libdispatch.dylib 0x224cbcab _dispatch_client_callout (in libdispatch.dylib) + 23
8 libdispatch.dylib 0x224d0559 _dispatch_main_queue_callback_4CF (in libdispatch.dylib) + 1533
9 CoreFoundation 0x228fb7d5 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ (in CoreFoundation) + 9
10 CoreFoundation 0x228f9ccf __CFRunLoopRun (in CoreFoundation) + 1591
11 CoreFoundation 0x22848289 CFRunLoopRunSpecific (in CoreFoundation) + 517
12 CoreFoundation 0x2284807d CFRunLoopRunInMode (in CoreFoundation) + 109
13 GraphicsServices 0x23e64af9 GSEventRunModal (in GraphicsServices) + 161
14 UIKit 0x26f732c5 UIApplicationMain (in UIKit) + 145
15 myapp 0x0009d4e7 0x98000 + 21735
16 libdyld.dylib 0x224f4873 start (in libdyld.dylib) + 3
So, what are the proper steps to create a react native production build for distribution in XCode?