Most of the time I debug my Android apps by connecting my device to Android Studio with a USB cable because it is more reliable.
I was developing an Android app that communicates with USB devices and ran into a problem: the phone needed to be connected to a USB device for testing, but Android Studio normally requires the phone to be connected to my Mac via USB for debugging.
Android’s built-in wireless-debugging feature is only available on newer versions, so I couldn’t enable it on the device running Android 10. However, there is a simple workaround. Follow these steps:
- Launch your app from Android Studio while connected via USB.
- On your Android device, open Settings and search for “IP address”.
- Note the device’s IP address.
- In Android Studio, open the terminal and run:
adb tcpip 5555 - Then run:
adb connect <ip_address_of_your_device>:5555

That’s it— you can now disconnect the USB cable and wirelessly debug your app on Android 10.