- Your Android-device has a Wi-Fi connection;
- Your workstation has a TCP/IP connection which is routable to the Android-device;
- Your Android-device is connected with your workstation using a USB-cable;
- ADB is installed on your workstation;
- You can connect via ADB with your Android device;
- There is just one unique Android-device connected with the workstation (either via USB or WIFI).
Steps to switch your Android-device from using USB to WIFI:
- Make sure your Android-device is connected via USB with your workstation and can be accessed via ADB
12List of devices attachedSOME_ANDROID_DEVICE device
- Find the IP address of your Android device. Either by looking it up in the router/DHCP-leases or ask it the device directly via ADB.
1adb shell ip -f inet addr show wlan0
1237: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000inet 192.168.178.100/24 brd 192.168.178.255 scope global wlan0valid_lft forever preferred_lft forever
Here the IP address is: 192.168.178.100
- Tell the ADBD daemon at the Android device to start listening for TCP/IP connections on port 5555. Execute this command from your workstation:
1adb tcpip 5555
1restarting in TCP mode port: 5555
- Tell the ADB server at the workstation to connect via TCP/IP to the Android device. Use in this command the IP-address you looked up before.
Execute at your workstation:
1adb connect 192.168.178.100:5555
1connected to 192.168.178.100:5555
Hint: Make sure your firewall accept these kind of connections.
- Check the possible connections with your Android-device. Ask ADB for the connected devices by issuing this command from your workstation:
123List of devices attached192.168.178.100:5555 deviceSOME_ANDROID_DEVICE device
- The new method via WIFI and;
- The old one via the USB-connection
When you don’t want to explicitly state every time you use ADB to which specific device (parameter: -s) the command is targeted, it is a good moment to disconnect the USB-cable now. This is directly a proof that command travel through the air from now on.
- Issue an ADB-command. For example ask information about the CPU:
1adb shell cat /proc/cpuinfo
. Your device should respond with something like this:123456789101112Processor : ARMv7 Processor rev 3 (v7l)processor : 0BogoMIPS : 1191.73Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivtCPU implementer : 0x41CPU architecture: 7CPU variant : 0x0CPU part : 0xc07CPU revision : 3Hardware : MT8127Revision : 0000Serial : 0000000000000000<
Extra: When you would like to restart the ADBD daemon at the Android device in USB mode again, issue the command:
Warning, you will lose the ADB-WIFI connection immediately. Start with step 3 (adb tcpip 5555) to set up the ADB-WIFI connection again.
This tutorial was written using as workstation a computer running Ubuntu (16.10), using version 1.0.36 of ADB. The target device was a Lenovo Essential Tab7 running Android version: 5.0.1.