React Native: release and debug builds
31 May 2021 at 4:04 pm
I’m currently building an app using React Native and overall, it’s a good experience. Most things you wonder about can be searched, but toggling between release and debug builds wasn’t described in any updated way.
My primary reason for wanting to turn off Debug features was to test how I could expect the app to work. My app will connect directly to a hardware device that offers an access point, so when I start the app there is also a 2 minute timeout waiting for the Metro server to connect that I can do without.
Searching, I found lots of entries telling you to edit the file named “RTCDefines.h”, but I cannot find that on my Mac. It turns out that to test a Release build on iOS, you just use the XCode menu Product > Scheme > Edit Scheme and toggle Debug output. React Native will use this setting and when exported, the entire app loads instantly and feels super snappy:
To go back to Debugging, make sure you turn on the Debug executable checkbox.
Hope this is useful for others.