To make your app development in Android devices easier, you can deploy or debug your application via Wifi (Wireless). It’s way easier to scale rather have multiple devices connected via USB cable on a single laptop.
Even better, this approach is very effective when you need to manage multiple devices together remotely. But, at the first step, you need to connect your Android devices to your laptop via USB cable.
This is the guidelines on how to do
adb connect to multiple devices via wireless network. You can also assign multiple IP into same adb server. Or even you can use the same IP with different ports and different devices.
λ adb devices List of devices attached 9886334a5350534332 device Restart into tcpip mode λ adb tcpip 5555 restarting in TCP mode port: 5555 Detach from usb and now connect adb connect 192.168.100.81:5555 connected to 192.168.100.81:5555
1. Check connected devices
Connect your devices via USB cable then execute
adb devices via command prompt, You should your devices already connected.
adb devices List of devices attached RR8M20XXXX device 192.168.1.81:5555 device
In this example, I’ve one device connected to USB and another already via remote attached to local IP network.
2. Select device and change to TCP mode
Choose which device with
-s and execute
tcpip <port>. In this case, I will choose port 5000
adb -s RR8M20XXXX tcpip 5000
You will hear that your devices is being disconnected and re-connect again.
3. Get your device IP address
adb -s RR8M20XXXX shell ip -f inet addr show wlan0
17: wlan0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 inet 192.168.1.79/24 brd 192.168.1.255 scope global wlan0 valid_lft forever preferred_lft forever
4. Hook-up the IP address into tcp
adb -s RR8M20XXXX connect 192.168.1.79:5000
Done, you can remove the cable and recheck again with adb devices.