你如何调试react-native使用的自定义android模块

时间:2015-12-09 21:25:58

标签: react-native

一直在考虑编写用于反应的android模块,但我很难调试我的原生android代码...

我可以调试本机反应原理JS而不发布......

任何想法????

1 个答案:

答案 0 :(得分:8)

使用Android记录器。例如:

import android.util.Log;

// later
Log.e("MyComponent", "Message to log");

然后使用logcat来监视您设置的消息:

adb logcat *:S MyComponent:V

或者查看您的消息以及所有其他React错误和警告:

adb logcat *:S ReactNative:V ReactNativeJS:V MyComponent:V
相关问题