ADB to Android device over WiFi

  • Thread starter Swamp Thing
  • Start date
  • #1
Swamp Thing
Insights Author
908
572
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.
 

1. What is ADB?

ADB (Android Debug Bridge) is a command-line tool that allows communication between a computer and an Android device. It is mainly used for debugging and installing applications on Android devices.

2. How can I use ADB to connect to my Android device via WiFi?

To use ADB over WiFi, you need to connect your Android device and computer to the same WiFi network. Then, enable ADB over WiFi on your device by running the command adb tcpip 5555. Finally, use the command adb connect <device IP address> to establish a connection between your device and computer.

3. Can I use ADB over WiFi without connecting a USB cable?

Yes, ADB over WiFi allows you to connect to your Android device without the need for a USB cable. This can be useful in situations where a physical connection is not possible or convenient.

4. Is ADB over WiFi secure?

ADB over WiFi is not as secure as using a USB connection, as it can potentially be accessed by anyone on the same WiFi network. It is recommended to use ADB over WiFi only for local debugging or development purposes, and not for sensitive data transfer.

5. How can I disable ADB over WiFi on my Android device?

To disable ADB over WiFi, you can either reboot your device or run the command adb usb to switch back to USB mode. You can also disable it permanently by going to Settings > Developer options and turning off the "ADB over network" option.

Similar threads

  • Computing and Technology
Replies
3
Views
2K
Replies
6
Views
3K
  • Computing and Technology
2
Replies
43
Views
3K
Replies
3
Views
2K
  • Computing and Technology
Replies
15
Views
4K
  • Computing and Technology
Replies
2
Views
6K
  • Programming and Computer Science
Replies
1
Views
745
  • Computing and Technology
Replies
3
Views
13K
Replies
5
Views
9K
  • Programming and Computer Science
Replies
2
Views
859
Back
Top