Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do logging in React Native

How can I log a variable in React Native, like using console.log when developing for web?

like image 775
skyline75489 Avatar asked May 08 '15 03:05

skyline75489


People also ask

How do I use console log in Expo React Native?

Option 1: Use GUI logIn simulator, press Cmd ⌘ + / , or go to Debug -> Open System Log -- both of these open a log window that displays all of the logs from your device, including the logs from your Expo app.

How do I run React Native apps in debug mode?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.


1 Answers

Use console.log, console.warn, etc.

As of React Native 0.29, you can simply run the following to see logs in the console:

react-native log-ios react-native log-android 
like image 196
Martin Konicek Avatar answered Oct 22 '22 10:10

Martin Konicek