Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable the Android monitor in React Native for checking logs?

I am new in react native. I want to see the logs of my react files. I am using android studio for using react-native project and genny motion as a simulator. Can you please guide me, how can I see the logs or enable android monitor in android studio?

Even I have already install react dev tools from Facebook for debugging the code: https://facebook.github.io/react-native/docs/debugging.html

but not able to get the particular solution

Already visit: How do you debug React Native?

How to do logging in React Native? I have checked so many solutions but it is not working in android 6.0 versions

But not working please guide me, Thanks in Advance

like image 480
Madhur Avatar asked Jul 26 '17 06:07

Madhur


People also ask

How do you display logs in React Native?

Note that as of React Native 0.29 and later, you can get logs without running the debugger. Just run react-native log-ios or react-native log-android on the command line inside your project folder. And when you open the Remote JS Debugging, you have to press option+command+i and check the console.

How do I enable remote debugging in React Native?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

How do you check Logcat in React Native?

Yes, it was right there on React Native documentation. Run adb logcat *:S ReactNative:V ReactNativeJS:V in a terminal to see your Android app's logs.


1 Answers

If you're using window, you can try hit CTRL+M, else in mac CMD+D to open debugging menu. Once it open, choose REMOTE JS DEBUGGING, it will automatically open chrome browser for you to debug js error. Android studio debugging will work if you're connected on real device.

Eg. of Debugging Menu

Debugging menu

I've found out the answer for genYmotion from How do you debug react-native?. Don't know whether it'll work for you, but worth for try.

For an Android App, if you're using Genymotion you can toggle the menu by pressing ctrl + m, but you may have to enable it in the menu by :

  • Untick untick widget
  • click on debug in chrome

enter image description here

like image 129
digit Avatar answered Nov 15 '22 14:11

digit