Reputation: 95
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) :
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
Upvotes: 3
Views: 9887
Reputation: 11
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
Upvotes: 1
Reputation: 616
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
Upvotes: 1
Reputation: 11
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.
Upvotes: 1
Reputation: 36
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.
Upvotes: 0
Reputation: 2069
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
Upvotes: 1