Where is console.log output when running app on android real device in react native
Asked Answered
T

3

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

Tigrinya answered 25/12, 2018 at 5:16 Comment(0)
G
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

Gilbertson answered 25/12, 2018 at 6:3 Comment(0)
L
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.

Latinism answered 26/12, 2018 at 6:29 Comment(0)
L
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

Larkins answered 25/12, 2018 at 5:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.