Reputation: 257
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?
Upvotes: 10
Views: 15089
Reputation: 1586
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?
Upvotes: 18