0

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. :)

9
  • 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)... Commented Aug 23, 2017 at 6:10
  • Did you try adb logcat *:S ReactNative:V ReactNativeJS:V and you problem didn't solve? Commented Aug 23, 2017 at 6: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 Commented Aug 23, 2017 at 6:32
  • How did you install your app in your adb? Commented Aug 23, 2017 at 6:41
  • When you type adb devices in console is your devices listed there? Commented Aug 23, 2017 at 6:42

1 Answer 1

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

  1. Install Google Chrome, if you have not already
  2. Run app using react-native run-android or react-native run-ios
  3. Open developer menu
    • Mac: ⌘+D for iOS or ⌘M for Android iOS
    • Windows/Linux: Shake Android phone
  4. Select Debug JS Remotely
  5. This should launch the debugger in Chrome
  6. In Chrome: Tools -> More Tools -> Developer Options and make sure you are on the console 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).

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

1 Comment

This is an alternative to running react-native log-android to see your logs

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.