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. :)
1 Answer
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-androidorreact-native run-ios - Open developer menu
- Mac:
⌘+Dfor iOS or⌘Mfor 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 Optionsand make sure you are on theconsoletab
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).
1 Comment
alexdriedger
This is an alternative to running
react-native log-android to see your logs
adb logcat *:S ReactNative:V ReactNativeJS:Vand you problem didn't solve?adb devicesin console is your devices listed there?