ADB to Android device over WiFi

  • Thread starter Swamp Thing
  • Start date
In summary, "ADB to Android device over WiFi" refers to the process of connecting an Android device to a computer wirelessly using Android Debug Bridge (ADB). This enables developers to run commands, debug applications, and transfer files without needing a USB cable. To set it up, users typically enable "Developer Options" on their device, connect via a USB cable initially to establish a connection, then disable the USB and use the device's IP address to connect over WiFi. This method enhances convenience for development and testing purposes.
  • #1
Swamp Thing
Insights Author
964
667
I have enabled Wireless Debugging on my Android phone. The wireless debugging setup screen displays an IP address and a port number.

When I do this:
Code:
 adb connect 192.168.1.22:33237
... it says "failed to connect ... connection refused".

Why is that?

Edit:
  • BTW, I am able to connect ADB to the phone via USB.
  • It I do adb tcpip 33237 it says "no devices/emulators found"
 
Last edited:
Computer science news on Phys.org
  • #2
Security?... so "just anybody" can not eavesdrop?
 
  • #4
It's been quite a while, but I thought the correct port for ADB wirelessly would be 5555.
 
  • #5
Svein said:
33237 is the port number (a very unusual one). https://isc.sans.edu/data/port.html?port=33237
Yes, it'a a port number. Each time you enable Wireless Degugging, it comes up with a new random port number.

1691977693466.jpeg


AngryBeavers said:
It's been quite a while, but I thought the correct port for ADB wirelessly would be 5555.
It depends. See below.Some digging and trial-and-error later, I have learned that there are two ways to do ADB over WiFi. There is the classic/legacy way that has existed for years, that uses port 5555. And there is a newer way based on "pairing" with a passcode/QR code. The new way uses random port numbers that the phone tells you to use. Newer ADB clients support a "pair" command that does this.

I have to use the older method because the ADB client for Raspberry Pi OS (which I'm using) hasn't caught up with the times. In the older method you have to first connect on USB, then do
Code:
 adb tcpip 5555 
adb connect 192.168.1.5:5555
after which adb devices will show a USB session and a Wifi session.

At this point you just pull the USB plug and continue on WiFi.
 

FAQ: ADB to Android device over WiFi

How can I connect my Android device to ADB over WiFi?

To connect your Android device to ADB over WiFi, you first need to connect your device to the same WiFi network as your computer. Then, enable ADB over WiFi in the Developer Options on your device. Finally, run the command "adb connect [device IP address]" in the terminal on your computer to establish a connection.

Can I use ADB over WiFi without a USB cable?

Yes, you can use ADB over WiFi without a USB cable. Once you have set up the connection between your Android device and computer over WiFi, you can execute ADB commands just like you would with a USB connection.

Is it safe to use ADB over WiFi?

Using ADB over WiFi is generally safe as long as you take necessary precautions such as ensuring that your device is connected to a secure network and enabling ADB over WiFi only when needed. It is recommended to disable ADB over WiFi when not in use to prevent unauthorized access.

Can I debug my Android app using ADB over WiFi?

Yes, you can debug your Android app using ADB over WiFi. Once you have established a connection between your device and computer, you can run debugging commands, inspect logs, and perform other debugging tasks just like you would with a USB connection.

What are the advantages of using ADB over WiFi?

Some advantages of using ADB over WiFi include the convenience of not having to use a USB cable, the ability to debug multiple devices simultaneously, and the flexibility of moving around with your device while debugging. It can also be useful in scenarios where a physical connection is not feasible or practical.

Back
Top