I am currently working on a project. In that project, I am printing console.log but no messages are printing anywhere.
I am using npm and react-native-cli to run on a real android device.
Thanks
I am currently working on a project. In that project, I am printing console.log but no messages are printing anywhere.
I am using npm and react-native-cli to run on a real android device.
Thanks
If you use a simulator, you can press Cmd + M (on Android) or Cmd + D (on IOS) to see the "Debug JS Remotely",
If you use a real device, you should shake the device and you can see the "Debug JS Remotely" option.
"Debug JS Remotely" option will popup Chrome and from there you can use the Developer Tools.
Below are the ways to check the Console messages in React Native. Once you run the application:
For Android:
1) For real device, shake so that you can view the Developer Options. For a simulator, press ⌘M (Mac) or Ctrl+M(Windows) to bring up the same. Press "Debug JS Remotely", which would open Chrome Debugging. You can then view the Console of Chrome's developer tools to check the messages.
2) Open Android Studio, and in the Logcat window for your device/simulator you can view all the messages including Console logs.
For iOS:
1) For real device, shake so that you can view the Developer Options. For a simulator, press ⌘D (Mac) to bring up the same. Press "Debug JS Remotely", which would open Chrome Debugging. You can then view the Console of Chrome's developer tools to check the messages.
run command react-native log-android to see all logs in react native.
or
use debug js remotely in developer menu to see logs
for more details debugging visit https://facebook.github.io/react-native/docs/debugging#chrome-developer-tools
© 2022 - 2024 — McMap. All rights reserved.