gpt4 book ai didi

ios - 设置调试或发布 | react native - iOS

转载 作者:可可西里 更新时间:2023-11-01 17:04:30 25 4
gpt4 key购买 nike

如何在 React Native for iOS (Xcode) 中设置 Debug 或 Release 模式,就像我们过去在 Build Setting->LLVM Preprocessor over Native code 中所做的那样?有什么办法或者我需要在 JS 代码中指定吗?如果没有办法,那么我们应该如何在 React Native JS Code 中访问 Xcode 设置的属性呢?

最佳答案

设置调试或 Release模式:

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.

来源:https://facebook.github.io/react-native/docs/debugging.html

在调试或 Release模式下访问信息:

if (__DEV__) {
console.log('I am in debug');
}

来源:How can I determine if my React Native app is a debug or release build from JavaScript code?

关于ios - 设置调试或发布 | react native - iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38202209/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com