React native - Programmatically check if in remote JS debugging is enabled

后端 未结 7 848
小蘑菇
小蘑菇 2021-02-01 19:04

On React-Native, how can I know if \"Debug JS Remotely\" is enabled?

I tried looking in RN docs and various NPM packages, but couldn\'t find out how...

7条回答
  •  灰色年华
    2021-02-01 19:49

    For Android, in the a shared preferences you can find the remote debug status. When I open the sharedPreferences file for my app.

    Remote debug active

    
        
        
        
    
    

    Remote debug inactive

    
        
        
        
    
    

    So (Android only), you can use a module like this one : https://github.com/sriraman/react-native-shared-preferences to check if the remote debug is active.

提交回复
热议问题