Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug react-native in Android Studio

I am coding React-native in Android Studio for Windows and using the Emulator. I have no idea how to debug my code?

How can I console.log in the code and see the results? How can I inspect elements? How can I put a break point in the code?

Any suggestion on the tools/tutorial will be a great help.

Thanks Negin

like image 745
Negin Basiri Avatar asked Oct 21 '16 04:10

Negin Basiri


People also ask

How do you debug in React Native?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

Can I code React Native in Android Studio?

You will need Node, the React Native command line interface, a JDK, and Android Studio. While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.


1 Answers

  1. Mark near line no. from where you want debug
  2. Debug the project which shows beside the run icon.
  3. Perform your Ui task where perform your debug line(it will shows mark near line number when it calls)
  4. You can move the line up and down from debug console.
like image 139
vishal patel Avatar answered Sep 22 '22 07:09

vishal patel