ADB to Android device over WiFi

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

Related to ADB to Android device over WiFi

1. 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.

2. 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.

3. 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.

4. 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.

5. 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.

Similar threads

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