Debugging Android wirelessly for React Native (made easy)

Running the Android emulator is an option, but it can be sluggish. Not to mention it takes up more laptop battery and more screen space.

Luckily the Android Debug Bridge (adb) supports wireless debugging!

Here’s how to set it up for your React native project.

Add this script to your package.json.

"android-wifi": "adb kill-server && adb tcpip 5555 && adb connect && adb devices"

You should replace the IP address in the above script with your phone IP. This can be found under Settings > About > Status > IP address

Note: (For this to work, your phone should have been connected to your computer at least once to accept the computer as a trusted device. Also, your phone should be on the same wifi network as your computer.)

Next run the script in your terminal: (yarn android-wifi or npm run android-wifi). The script should finish by outputting the list of connected devices.

List of devices attached device

And that’s it. Disconnect your phone and boom! You can now debug your React native project on an Android phone wirelessly. Have fun!

Robert is a React-Native Developer currently working at MediaMonks, with a BSc. in Multimedia & Computer Games Development from the University of Limerick.