检测运行时是否运行调试或发布版本

pst*_*ton 6 react-native

有没有办法确定当前运行的反应本机应用程序是否是调试版本?专门针对 Android,但希望与平台无关。

Wol*_*ine 9

使用 DEV 标志

  if (__DEV__) {
        console.log('I am in debug');
    }
Run Code Online (Sandbox Code Playgroud)