如何在React Native中记录日志? [英] How to do logging in React Native?
本文介绍了如何在React Native中记录日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在React Native中记录变量,就像在为Web开发时使用console.log
一样?
How can I log a variable in React Native, like using console.log
when developing for web?
推荐答案
console.log
可行.
在iOS上,默认情况下,它会记录到Xcode内的调试窗格中.
By default on iOS, it logs to the debug pane inside Xcode.
在IOS模拟器中,按(⌘ + D ),然后按 Remote JS Debugging .这将在本地主机上打开资源 http://localhost:8081/debugger-ui .从那里使用Chrome Developer工具javascript控制台查看console.log
From the IOS simulator press (⌘+D) and press Remote JS Debugging. This will open a resource, http://localhost:8081/debugger-ui on localhost. From there use Chrome Developer tools javascript console to view console.log
这篇关于如何在React Native中记录日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文