How to set Debug or Release mode in React Native for iOS (Xcode) like we used to do in Build Setting->LLVM Preprocessor over Native code? Is there any way or do I need to specify in JS code itself? If there is no way then how should we access the property set by Xcode in React Native JS Code?
Expo allows us to build for both Android and iOS on Windows, Mac and Linux. You can run your React Native app on a physical device without setting up the development environment. All you need to do is download the Expo Go app, run expo start and then scan the QR code that shows up.
Set debug or release mode:
For iOS open your project in Xcode and select Product → Scheme → Edit Scheme... (or press ⌘ + <). Next, select Run from the menu on the left and change the Build Configuration to Release.
For Android, by default, developer menu will be disabled in release builds done by gradle (e.g with gradle assembleRelease task). Although this behavior can be customized by passing proper value to ReactInstanceManager#setUseDeveloperSupport.
Source: https://facebook.github.io/react-native/docs/debugging.html
Access the information if you are in debug or release mode with:
if (__DEV__) {
console.log('I am in debug');
}
Source: How can I determine if my React Native app is a debug or release build from JavaScript code?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With