When we are making Android apps, We have to connect our android device to our laptop with a USB cable. The USB cable is annoying and limits our movements. But don’t worry I know a little trick how to connect mobile to android studio without USB cable.
In this article I will show you how to connect mobile to android studio without USB cable.
All you need is a USB cable (for the initial setup) and have both devices in the same network. The screenshots in the following section are from my Linux Mint, but it works on any operating system.
Steps to connect mobile to android studio without USB cable
- You need to connect your device to your computer via USB cable. Make sure USB debugging is working. You can check if it shows up when running
adb devicesin your CMD.
adb tcpip 5555
- Disconnect your device (remove the USB cable).
- Go to the Settings -> About phone -> Status to view the IP address of your phone.
adb connect <IP address of your device>:5555
If you run
adb devices again, you should see your device.
Now you can execute adb commands or use your favorite IDE for android development – wireless!
Do I Have to Repeat the Process Every Time?
Now you might ask, what do I have to do when I move into a different workspace and change WiFi networks? You do not have to repeat steps 1 to 3 (these set your phone into WiFi-debug mode). You do have to connect to your phone again by executing steps 4 to 6.
Unfortunately, the android phones lose the WiFi-debug mode when restarting. Thus, if your battery died, you have to start over. Otherwise, if you keep an eye on your battery and do not restart your phone, you can live without a cable for weeks!