ADB wireless not working with PC connected via Ethernet cable - android

I wanted to connect to my device wirelessly so I can install apps via ADB without cables. The problem is that I can't connect to my device.
My device is connected to my home's WiFi and PC via Ethernet cable but in the local network. Why I can't connect?
I'm doing this:
adb tcpip 5556
adb connect myipaddress:5556
but It's not working...

You have to connect your phone directly to your PC with USB cable for command
adb tcpip 5556. Otherwise your device will not set the tcpip port.
connect phone on PC with USB, then enter adb tcpip 5556 and then you can disconnect it. after that second command adb connect myipaddress:5556 will connect your device wirelessly.
And myipaddress must be IP of your phone device.

I had the same problem.
While the phone is wired, ADB over WiFi fails. Once you unplug you should be able to use ADB over WiFi.
I am in need to have the phone wired for one network while using ADB over the WiFi but not a successful scenario.

Related

How can I debug an Android device without cable(Not even without the initial connection)

Typical way is
Connect PC to the device with USB Cable.
adb tcpip 5555
adb connect 192.168.xxx.xxx:5555
However, what if the device manufacturer doesn't recommend this way. But connect them directly wirelessly?
What they say is
PC and Device must use the same Wifi
Check IP address of the device.
adb connect 192.168.xxx.xxx:5555
And I found this blog that says I don't need to connect USB to the real device. But run anything adb to detect any one device.
Run an emulator.
adb tcpip 5555
adb connect 192.168.xxx.xxx:5555
However, I get Connection refused error with the second and third method. What should I do? How can I debug this device?
*The port 5555 is not being used.

ADB over TCP/IP not working without USB cable connected

I can connect to my smartphone with ADB using a usb cable,
I'm also able to connect over tcp/ip to the same smartphone with
adb connect 192.168.1.110 while the usb cable is still connected.
But, as soon as I disconnect the cable, I loose the tcp/ip connection, the device appears to be "offline" (as result to "adb devices" command) and I cannot reconnect over network until I re-connect the cable.
My steps are (this way it works) :
connect the usb cable
adb kill-server
adb tcpip 5555
adb connect 192.168.1.110 (here it connects succesfully!)
disconnect usb cable => I loose network connection to the smartphone
If after step 3 I disconnect the cable, the step 4 doesn't work (port 5555 closed)
It seems like adbd daemon is running ONLY when the cable is connected.
AS my device is not rooted I don't find any way to force adbd daemon to start without connecting the usb cable.
Any idea?
[UPDATE]
I just tried to scan the smartphone for tcp port opened and I found that as soon as I run the command:
adb tcpip 5555
the scanning found the port 5555 opened
but as soon as I disconnect the usb cable, I run again the scan and the port 5555 is found to be closed
This confirm that as soon as I disconnect the usb cable don't know why but adb stop responding on port 5555 or the daemon itself get killed or similar
[UPDATE]
I just did the same steps on another Android device (an asus tablet) and it works perfectly, when I disconnect the cable, the tcp port remain opened, so the issue is not with the steps I'm following but with something else
[UPDATE]
I found other posts with similar issue, this is one of them:
adb connection by wifi getting killed when a new USB attached/detached
, unfortunately I cannot do what he says as my smartphone is not rooted and I'm am in the same situation of comment by Osama in that post
I'm also testing on a Honor phone. I found a solution to solve this problem. You can try to turn on Allow ADB debugging in charge only mode and turn off Always prompt when connecting to USB. It should fix the problem.
Here is the reference for the solution.
Bellow commands allows you always get 5555 as default port number, try this out
Make sure you have wifi configured as "auto connect", also set always allow the adb from net work under developers manul
adb root
adb remount
adb shell setprop persist.service.adb.enable 1
adb shell setprop persist.adb.tcp.port 5555
adb reboot
Hello I can solve problem
First of all connect your device with cable (usb debbuging) click on allow on phone if it asks about debugging
Now open cmd
type cd 'Location of scrcpy'
than type the following
adb tcpip 5555
If it asks you again to do adb tcpip 5555 do it again
adb connect <'device-ip-adress'>
Disconnect the device by removing the cable
scrcpy -s <'device-ip-adress'>
Done! Problem Solved
Firstly connect your device and check if it's connected or not
RUN
adb devices
then
RUN
adb tcpip 5555
now disconnect your device usb cable and go to the settings and find out the IP Address of your phone and RUNn
adb connect your_phone_ip_address
eg. adb connect 192.168.1.102
replace with your own ip and check it with adb devices if it's connected or not
if it's not working then the problem must be something else
You probably don't have The ADB Server running.
With the USB cable connected,
do:
adb kill-server && adb start-server && adb tcpip 5555 && adb connect 192.168.1.110
Once Successfully Connected, You can then Disconnect the Cable.
NOTE: on running adb devices, the device name is now of the format IP:PORT as opposed to the initial Alphanumeric string.

Connect more than one android devices without USB(using wifi) is it possible?

I follow following steps for the connecting my device and already go-through this link Adb over wireless without usb cable at all and Connecting two android devices using wifi still not connected and this onle also adb error: more than one device - android
I connect my device to my computer via USB cable.
Go to platform tool path.
Run adb tcpip 5555.
Disconnect my device (remove the USB cable).
I Go to the Settings -> About phone -> Status to view the IP address of my phone.
Run adb connect :5555.
I get this error on terminal:
EDIT:
You have to provide the device id as well to open adb over wifi when more than 1 device is connected.
adb -s <device ID> tcpip 5555
I got the asnwer from here:
https://stackoverflow.com/a/38348791/4428159
provide your phone ip as well:
adb: usage: adb connect <host>[:<port>]
host is the ip address of the mobile you want to connect.
You have to do this for all the devices you want to connect to.

Nexus 9 (OS -6) adb connection over tcp not Working

After upgrading my device to Marshmallow, I am unable to connect my device on tcpip for wifi debugging (It used to work on Lollipop). IP is my device IP address.
platform-tools>adb connect IP:5555
I am getting below message
unable to connect to IP:5555
I also tried to connect on 7612 port.
5555 is the port number which is not used while connecting. Connection takes place in to steps:
Set port on which connection is to be stablished(in this case 5555)
Connect to the device using it's IP address.
So let's say your device IP is 192.168.1.1 and you want to connect over port 5555,
adb tcpip 5555
adb connect 192.168.1.1
Try the following
Make sure that Aggressive Wi-Fi to Cellular handover under Networking section in the device's developer options is turned off.
ping continuously from your pc to the device to make sure it's not in network idle mode
ping -t 192.168.1.10 (windows cmd), unlock the device and even try to surf to some
website just to make it get out of the network idle.
If ping doesn't work, turn off / on Android Wifi and go back to step 2.
When it replies to the ping, connect it via usb, and:
adb usb
adb tcpip 5555
adb connect 192.168.10.1:5555
In case it's still not connected, try to switch the usb connection mode as MTP / PTP /
Camera while the device is connected through usb and repeat these steps over again...
If the above points are not working please try running adb as admin. For Ubuntu -
sudo adb start-server
as stated here

Android ADB connect over TCPIP not working

I Connected my moto g2(Lollipop) to adb over WIFI using the commands
adb tcpip 5555
adb connect 192.168.2.6:5555
It was successfully connected
when i checked how many devices are connected.
It was showing 2 devices.
1.Device over USB
Device over WIFI with the IP address
So i need to use the device with WIFI So i unplugged the usb
To my Shock both devices are disconnected. I dont why? Please Help me
Restart the adb connection with an adb kill-server then you should be able to reconnect and see your device with adb devices again.
Sidenote: I like this app to use adb over wifi.

Categories

Resources