Saturday, August 30, 2025

Steps for Wireless Debugging

To See All React Native Articles: Index of Lessons in Technology

Yes 👍 wireless debugging is very handy in React Native, especially when your USB is unreliable. Here’s a step-by-step guide to set up wireless debugging with Android (ADB):


📱 1. Prerequisites

  • Android device (e.g., your Redmi A2 or Galaxy A06 5G)

  • Android 11+ (Wireless debugging is built into Developer Options)

  • Laptop with ADB installed (platform-tools package)

  • Both laptop and phone must be on the same Wi-Fi network


⚙️ 2. Enable Developer Options & Wireless Debugging

On your phone:

  1. Go to Settings → About phone → Tap Build number 7 times (to enable Developer Options).

  2. Go to Settings → Developer options.

  3. Turn on:

    • USB debugging (first time setup)

    • Wireless debugging


💻 3. First Pairing (via QR or Code)

  1. Run ADB on your laptop:

    bash
    adb pair ip:port
  2. On your phone → Developer options → Wireless debugging → Pair device with pairing code

    • It will show an IP:Port (like 192.168.0.105:37099)

    • And a 6-digit pairing code

  3. Enter it in terminal:

    bash
    adb pair 192.168.0.105:37099

    → If successful: Successfully paired to 192.168.0.105:37099


🔗 4. Connect ADB Over Wi-Fi

Now actually connect the device (different port from pairing one):

  1. Still in Wireless debugging, find IP address & Port for debugging (like 192.168.0.105:5555).

  2. Connect:

    bash
    adb connect 192.168.0.105:5555

    → You should see: connected to 192.168.0.105:5555

  3. Verify:

    bash
    adb devices

    Output should show:

    nginx
    List of devices attached 192.168.0.105:5555 device

🚀 5. Run React Native App Wirelessly

Now just run your app as usual:

bash
npx react-native run-android

It will install and debug over Wi-Fi without USB. 🎉


⚡ Troubleshooting

  • If adb connect fails → make sure phone & laptop are on same Wi-Fi.

  • If it disconnects after restart → you’ll need to re-pair.

  • Sometimes adb kill-server && adb start-server helps reset.


👉 Do you want me to also give you steps for QR pairing inside Android Studio (so you don’t need terminal at all), or you prefer ADB command-line only?

TESTING

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ adb connect
adb: usage: adb connect HOST[:PORT]

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ adb pair 192.168.1.2:44501
Enter pairing code: 652936
Successfully paired to 192.168.1.2:44501 [guid=adb-R9ZY3098GYX-8MEOzx]

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ adb connect 192.168.1.2:36161
connected to 192.168.1.2:36161

(base) jain@jain-ThinkPad-T440s:~/Desktop/ws/react_native_apps$ adb devices
List of devices attached
192.168.1.2:36161	device
adb-R9ZY3098GYX-8MEOzx._adb-tls-connect._tcp	device

No comments:

Post a Comment