Chris Legge
Chris Legge

Reputation: 789

How do you debug a custom android module used by react-native

Been diving into writing android modules for react but i am having a hard time debugging my native android code...

i can debug the react-native JS without and issue...

Any ideas????

Upvotes: 3

Views: 1827

Answers (1)

John Shammas
John Shammas

Reputation: 2715

Use the Android logger. For example:

import android.util.Log;

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

Then use logcat to watch for the messages you set:

adb logcat *:S MyComponent:V

Or to see your messages alongside all the other React errors and warnings:

adb logcat *:S ReactNative:V ReactNativeJS:V MyComponent:V

Upvotes: 10

Related Questions