Is there a way to debug native java code for Android app built using react-native
. Specifically, I want to debug a third party Android package that I am using in my react-native
app. There are may blog posts and stackoverflow questions on how to debug the js code but I didn't find any post describing how to debug native java code. I tried to just import the third party Android package into Android Studio and tried to run it in debugger but nothing really happened which I kind of expected.
Please let me know if and how it can be achieved. Thanks!
Show activity on this post. Launch the React Native packager by running 'react-native start' in the root directory of your React Native Project. Open the "android" directory of your React Native project in Android Studio. Then you will be able run and debug your React Native application from Android Studio.
Connecting a React Native app to React Native Debugger To connect your app with React Native Debugger, you need to run your app and start debug mode. To start debug mode, shake your mobile device or press Command + Shift + Z or Ctrl + M and choose the debug option.
You can open the project in Android Studio and debug any native code there (add breakpoints, debug step by step, etc).
Be sure to launch the React Native packager beforehand. And then launch your app from Android Studio in debug mode.
More info: https://developer.android.com/studio/debug/index.html
Launch the React Native packager by running 'react-native start' in the root directory of your React Native Project.
Open the "android" directory of your React Native project in Android Studio.
Then you will be able run and debug your React Native application from Android Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With