In this guide, we have covered an amazing trick to execute any ADB command simply over WIFi, without the need of any USB Cable. Android Debugging Bridge, or more popularly known as ADB, is among the most powerful command-line tool for Android devices. Part of the Android SDK and Platform-Tools, it provides for a successful connection between your PC and Android device. Right from booting your device to Fastboot or Recovery Mode, to flashing a custom recovery or sideloading OTA, the possibilities are endless. Keeping that in mind, we already have covered an extensive guide on some of the most powerful ADB commands.
Meanwhile, if you need to perform any of these ADB commands, the basic requirement is a USB cable. Until and unless you connect your device to PC via USB, you cannot carry out any of these ADB commands. Or so is a general notion. But today I found out an impressive hack using which you could execute any ADB command to your device just via WiFi without using any USB cable. But before beginning the same, some important prerequisites are to be kept in mind.
- Download and install the Android SDK platform-tools on your desktop. If you face any issue while setting it up on Windows 10, you may refer to our guide.
- Enable USB Debugging on your device. Go to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > Developer options > Toggle on the USB Debugging switch. For further explanation, head over to our guide on how to enable Developer options and USB debugging on Android.
- For this trick to work, your device, as well as PC, needs to be connected on the same Wi-Fi network.
So these were the important requirements to keep in mind. Let us now have a look at how to execute ADB Commands over WiFi without any USB Cable.
Executing ADB Commands over WiFi
For setting up the process, connect your device to USB. This is only a one-time requirement. Moreover, you need to keep a note of your Ip Address on your Android device. If you’re on Android 9.0 Pie or later, go to Settings > Network and Internet > WiFi > Tap on the connected WiFi > Advanced > Note your IP Address.
However, for Android 8.0 Oreo or previous versions, the method is slightly different. Go to Settings > About phone > Status > IP Address. Let’s now begin the process of executing ADB Commands over WiFi without a USB Cable.
- Go to the Android SDK and Platform Tools folder. Inside the same folder, type cmd in the address bar.
- This will open the Command Prompt window. You may carry out this procedure in the PowerShell window as well. For that, inside the platform-tools folder, right-click on an empty space while pressing the Shift key. Now click on Open PowerShell window here.
- If this is the first time, you will need to authorize your device for an ADB connection. A dialog box would appear on your device when you connect via USB. Tap on Always allow from this computer.
- Now type in the below code to check for a successful ADB connection. if you get an alpha-numeric code, the device is successfully connected:
- Before typing the below adb command, make sure your device and PC are connected to the same Wi-Fi network. Now type the below code:
adb tcpip 5555
- Next, enter the following code to connect your device to ADB via WiFi without USB cable.
adb connect <Device IP>:5555
For example, as my IP address is 192.168.0.2, the command in my case will be as follow. You may also have a look at the above image for reference.
adb connect 192.168.0.2:5555
- That’s it. You can now execute any ADB command over WiFi without the need for any USB Cable.
Things to keep in mind
If you connect your device via USB cable and type adb devices, you will get two device IDs. One will be in the form of the IP Address, with the :5555 (tcpip) suffix. The other one will be the alpha-numeric code. The latter one is the result of USB cable whereas the former is due to WiFi, as evident from the IP address.
If you wish to remove the WiFi device ID, simply closing and reopening the command shell won’t do any good. For that, you will have to kill the process. Type the below code in the command prompt to remove the same:
ADB Commands Via WiFi when the device is turned on
Till now we have discussed how to execute ADB commands via WiFi, without any USB cable. Now let’s have a look at some of the important ADB Command that could be executed in this wireless mode.
- adb devices
Shows a list of all the devices connected to PC in ADB state.
- adb reboot
Used to reboot your Android device
- adb reboot bootloader
To reboot your device to bootloader/fastboot mode, you may use this command.
- adb reboot recovery
To boot your device to stock or custom recovery like TWRP (if installed).
- adb install
Another useful ADB command that could be executed over WiFi without using a USB cable. It is used to install an APK to your Android device directly from the PC. Just make sure to move the APk file inside the platform-tools folder before executing the below code. If the name of the file is game.apk, then the command will be:
adb install game.apk
- adb uninstall
Similarly, to uninstall any APK from your Android device, type the below code. To get the ID of any app, search for the desired app on Play Store on Desktop. From the address bar, copy the content next to id=. To uninstall WhatsApp, the code will be:
adb uninstall com.whatsapp
- adb pull
Pull a file from your device and save it on your desktop. The file would be saved to the platform-tools folder. For example, to pull video.mp4, the command will be
adb pull /sdcard/video.mp4
- adb push
Used to push a file to your device from your PC. Keep the file in the platform-tools folder to push it on your device.
adb push video.mp4 /sdcard
Given above are only some of the adb commands. To get a complete list of all such commands, have a look at the List of ADB and Fastboot Commands for Android.
With this, we conclude the guide on how to execute ADB commands over WiFi without using a USB Cable. Do let us know if you face any issues during the process. Your views are also welcome on this pretty useful trick.
Join The Discussion: