5

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

3 Answers 3

11

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.

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

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.