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

Adit Modi
  • 1
  • 3

1 Answers1

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

alexdriedger
  • 2,884
  • 2
  • 23
  • 30