简体   繁体   中英

How do I debug React Native native module in android studio?

Looking for an answer I came across this post: https://stackoverflow.com/a/38007808
However I don't know how to...

launch the React Native packager beforehand

as Jean Regisser suggest to do before in order to start debugging.

This is what I tried so far:

  1. Go to android studio and press play button
  2. Run react-native start and press play button from android studio
  3. Run gradlew clean --> react-native start --> press play

Nothing works. Help!

First of all, you should open the android bin(which you have in your react native project) with android studio. And run "npm start" in your project.

And follow these instructions: https://developer.android.com/studio/debug/index.html

Finally I found a way:

  1. Start process like normal
  2. In android studio, press the button to attach debugger to a running app.

And that's it!

See: https://developer.android.com/studio/debug/index.html#attach-debugger to know which button I meant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM