I made a simple sign up form using react-native from scratch. I used 'react-native init login' Now to put validations I need to use console.log but I am not able to view them. I tried following some links to debugging but not able to view the logs. I am using Ubuntu 15.10 Kindly help. :)
Asked
Active
Viewed 446 times
0
-
I used react-native log-android but it gets stuck on starting the logger. react-native log-android Scanning 647 folders for symlinks in /home/trainees10/react-native-apps/login/node_modules (11ms) Starting the logger (adb logcat *:S ReactNative:V ReactNativeJS:V)... – Adit Modi Aug 23 '17 at 06:10
-
Did you try `adb logcat *:S ReactNative:V ReactNativeJS:V` and you problem didn't solve? – Vahid Boreiri Aug 23 '17 at 06:27
-
i did. adb server is out of date. killing... cannot bind 'tcp:5037' ADB server didn't ACK * failed to start daemon * error: device offline it is showing this @VahidBoreiri – Adit Modi Aug 23 '17 at 06:32
-
How did you install your app in your adb? – Vahid Boreiri Aug 23 '17 at 06:41
-
When you type `adb devices` in console is your devices listed there? – Vahid Boreiri Aug 23 '17 at 06:42
-
when I type adb devices it shows only one line List of devices attached @VahidBoreiri – Adit Modi Aug 23 '17 at 07:03
-
your device is appeared in the list like somethings like `2101109bb84fc34a device`? – Vahid Boreiri Aug 23 '17 at 07:09
-
Problem solved. updated the adb and ran emulator and debugger side by side. now able to view. thanks @VahidBoreiri for responding :) – Adit Modi Aug 23 '17 at 07:42
-
Happy to help you. – Vahid Boreiri Aug 23 '17 at 07:44
1 Answers
0
This is where Chrome Developer Tools are your friend.
The following steps should get you to the Chrome Developer Tools, where you will be able to see your console.log
statements.
Steps
- Install Google Chrome, if you have not already
- Run app using
react-native run-android
orreact-native run-ios
- Open developer menu
- Mac:
⌘+D
for iOS or⌘M
for Android iOS - Windows/Linux: Shake Android phone
- Mac:
- Select
Debug JS Remotely
- This should launch the debugger in Chrome
- In Chrome:
Tools -> More Tools -> Developer Options
and make sure you are on theconsole
tab
Now whenever a console.log
statement is executed, it should appear in Chrome Dev Tools. The official documentation is here. Also see this answer (which at the time of this answer is two years old and only for iOS).

alexdriedger
- 2,884
- 2
- 23
- 30
-
This is an alternative to running `react-native log-android` to see your logs – alexdriedger Aug 23 '17 at 08:30