Set ADB in TCP/IP mode: device not found? - android

I've already used this commands before to set ADB to listen on TCP/IP, but this time I'm stunned. The problem is that the error it's throwing just makes no sense:
$ adb tcpip 5555
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: device not found
In fact even trying to put it in USB mode doesn't work either, with same error:
$ adb usb
error: device not found
Just for the info, the adb help says that:
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
I've made no changes in Android SDK (no updates). Any help would be appreciated.

The issue was that I had to have an Android device connected (same device or another device) by USB to be able to execute
$ adb tcpip 5555
restarting in TCP mode port: 5555
Then I can just unplug this USB device and connect to the other devices on the LAN over TCP.
Just makes no sense at all.

Ensure your device is set for Debugging under Developer Tools, then on your host computer's command-line, type:
$ adb tcpip 5555 - restarts the adbd daemon listening on TCP on the specified port (typically 5555)
restarting in TCP mode port: 5555
If you get "error: device not found", you need to temporarily connect an Android by USB cable. (This doesn't even need to be the same device, and doesn't need to remain connected)
Then, connect to the Android device by IP address. (Ensure your Android is connected to your local network then to find the IP address, click on the wifi network connection to see connection details.)
$ adb connect 192.168.0.10 - connects over network to remote device IP (replace 192.168.0.10 with your Android device's IP address)
connected to 192.168.0.10:5555
Depending on your connection, this could take a minute or so to establish the first time.
To switch back to your USB connection, type:
$ adb usb - restarts the adbd daemon listening on USB
Additional Notes:
You do not need root access for this to work.
You may need to open port (5555) in your firewall.
You can use "ping " to
ensure your host can find the device on the network

What you probably want is:
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
so:
$ adb connect 192.168.1.38

adb usb and adb tcpip <port> commands control the transport mode of the adbd daemon running on the device. In order to change the mode the current transport has to be functional. In your case the adbd is running in USB mode - so you have to connect the USB cable in order for the mode change request to reach the deamon.
If you want to avoid having to connect USB just to enable the TCPIP transport - you can either change the default settings or switch it manually from a terminal emulator on the device itself.

I also encountered this problem and tried to solve them in a week. Finally it is solved within minutes when I change the setting in my device to allow the debugging when charging. I also ensure that the allow usb debugging enabled because sometimes when you choose to allow debugging when charging, the allow usb debugging will be disabled.
after that, I try the adb tcpip 5555 again and voila!!! no more no emulators... kinda message. I then connect using adb connect 'ip address':5555 and it works like charm.

After connect phone with usb, choose option at phone "charging only".

Related

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.

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

ADB : unable to connect to 192.168.1.10:5555

I cannot use adb connect to connect via WiFi to my device (Nexus 5, Android 6), but since I'm developing a cordova plugin using USB OTG, I really need to connect via WiFi.
I tried to adb kill-server, and all solutions provided on SO, and none is working for me...
Before it was working ok (i.e android 5).
Any idea?
I had the same issue since the android 6 upgrading.
I noticed that for some reason the device is playing "hard to get" when you try to contact it over WIFI.
Try these following steps:
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`
I had the same issue. i tried all commands like adb kill-server then
adb tcpip 5555 then
adb connect <IPAddress>:5555 but the issue remain same
the IP address which i used to connect ... showing me message unable to connect .....
what i did is
go to phone's settings
then About phone
then Status`
then check IP address
Now try to connect phone with that IP address
Note : - The problem is the IP address changed which i used to connect
First, you need to pair your computer :
Go to Wireless debugging > Pair device with pairing code.
Go to console of your pc and run adb pair ip:port pairing_code
Now , run adb connect ip:port on your pc and enjoy.
Go to Android Studio and you can the see new device.
I had the same problem. The solution was as follows.
In Developer Options.
+ Activate "Allow ADB debugging in load only mode."
+ In Spanish, "Permitir depuraciĆ³n ADB en modo solo carga."
Explanation
My problem was as follows: I was doing all the steps:
adb kill-server
adb start-server
adb tcpip 5555
adb connect (your ip).
After completing these steps, I disconnected the phone from the USB cable, and the connection was lost, I could not make the wireless connection.
However, this worked for me on a Huawei ALE-23 cell phone, but it did not work for me on the Huawei Y9S cell phone (Android 10), it failed.
I solved it only by activating the option "Allow ADB debugging in load only mode" in the cell Huawei Y9S.
Cheers!!!.
Make sure you are not connected to a VPN. I was able to connect to adb as soon as I disconnected from the VPN. For a sure way to connect do this:
Unplug USB
Restart Android device
Shutdown Android Studio or any other IDE using ADB
adb kill-server
Plug back in USB after restart
adb devices This automatically starts the server. You sould see the device plugged in via USB
adb shell ip addr show wlan0 to get your devices IP address
adb tcpip 5555 Set the port to 5555 that you want to connect through
adb connect 192.168.0.6:5555 Replace IP address with one from step 6.
Disconnect the USB
I used the same approach as #IVAN MANJARREZ ADB : unable to connect to 192.168.1.10:5555
The only difference was I used Huawei - p20 pro.
Where for p20 - pro, you have to search for and activate
"Allow ADB debugging in charge only mode"
I have tried everything but still, nothing worked for me. Then randomly, I used the following command:
$ adb tcpip 5555
error: no devices/emulators found
$ adb connect 192.168.0.104:5555
failed to connect to 192.168.0.104:5555
$ adb connect 192.168.0.104:5555
already connected to 192.168.0.104:5555
It was connected at this point but my device was offline. I was always able to connect at the second attempt but my device was always offline. At this point, I connected my device to my PC with USB.
$ adb tcpip 5555
error: more than one device/emulator
$ adb disconnect
disconnected everything
$ adb tcpip 5555
restarting in TCP mode port: 5555
$ adb connect 192.168.0.104:5555
connected to 192.168.0.104:5555
I disconnected my USB and voila! my device was still connected.
I am sorry but I can't explain why it worked. I was randomly trying different things on internet. I had used the same commands several times but in different orders but they didn't work. I hope it will help someone.
I solved this problem by disabling USB debugging and enabling it again
The critical step in getting this to work is disconnecting the usb cable after issuing the adb connect xx.x.x.xx:5555 command. At this point you are connected but unauthorized.
Execute adb kill-server and re-issue the connect command.
Verify with execution of adb shell date.
Similar issue happened to me when I tried to connect wirelessly to my phone. I got this error:
failed to connect to 192.168.1.187:42534
I tried to restart everything, phone, PC, adb server. The issue was simply that you have to connect by cable first to authorize the client and then you can unplag the cable and connect wirelessly.
In my case I had to shut of and on the wifi adb debugger app, on the device.
On another USB device I had to shitch off and on developer mode, then re-set the development options.
Also reset my pc.
Seem that adb in some way made a mess with global communication and all the debug communication have to be reset on both sides.
After this the devices start to comunicate again
sudo adb start-server
Just worked for me. after A day of looking for a solution.
So my situation was that i restarted it in tcp mode but still couldn't connect, i had an No route to host error ,so i tried pinging it but i couldn't find it either even though it was on the arp table. so what i noticed was that when i connect it by usb, it pings successfully. so i had to do the adb connect ip before i could unplug the usb.
I ran into this same issue on not being able to connect via Wi-Fi but was using the snap version of scrcpy. I kept seeing messages like adb server version (40) doesn't match this client (39); killing... when I would run adb or scrcpy commands but it still worked, until I tried to connect over Wi-Fi.
$ scrcpy
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
adb server version (40) doesn't match this client (39); killing...
* daemon started successfully
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1
I believe this means it was unable to push the server app to the device.
Running the commands to setup Wi-Fi using the adb built into the snap, scrpy.adb solved this for me.
$ scrcpy.adb tcpip 5555
$ scrcpy.adb connect 192.168.1.25:5555
connected to 192.168.1.25:5555
$ scrcpy
INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 0.6 MB/s (33622 bytes in 0.051s)
[server] INFO: Device: XXXXX XXXXXXX (Android 9)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 390.25
INFO: Trilinear filtering enabled
INFO: Initial texture: 1440x2560
connect using USB and Just use this command
adb tcpip 5555
It will restart services
and then adb connect <device-ip>:5555
Note: to find device IP, you can navigate to wifi -> YOUR_NETWORK -> IP address
I faced the same issue with the ADB over WiFi connection between my Android 10 phone and Windows 10 PC, which was OK before and suddenly this happened. After reading this question and answers above, I first turned off WiFi on my router and turned it back on.(I repeat not the router, just WiFi) It worked.
I created this powershell script that automates the connection to the phone, to make it work follow the steps and reassign the variables to make it work on your device
#Important!!!
# Enable developer options on your phone and follow the steps below:
# Step 0: Developer options > (USB debugging = true) and (Permanently accept the digital signature of the computer)
# Step 1: Developer Options > Active Screen = true
# Step 2: Developer options > Allow ADB debugging in load-only mode = true
$customPort = '5555'
$ipPhone = '192.168.1.53'
$fullIpPhone = $ipPhone + ':' + $customPort
Write-Host
Write-Host '=============Start script============='
adb usb
Write-Host
Write-Host '=============Start clean network============='
adb devices
adb disconnect
adb kill-server
adb devices
Write-Host
Write-Host '=============Start connection============='
adb tcpip $customPort
# adb tcpip 5555 # $customPort
adb connect $fullIpPhone
# adb connect 192.168.1.53:5555 # $fullIpPhone
adb devices
Write-Host
Write-Host '=============End script============='
I had the same issue. i tried all commands like adb kill-server then
adb tcpip 5555 then
adb connect :5555 but the issue remain same
the IP address which i used to connect ... showing me message unable to connect .....
what i did is
go to phone's Settings
then About phone
then Status`
then check IP address
Now try to connect phone with that IP address
Note : - The problem is the IP address changed which i used to connect
I'll add my two cents.
For some devices, you can directly connect by the address and port as specified in the Wireless Debugging section e.g 192.155.230.241:43522
use adb connect <IP:PORT>
If not successful, use adb connect <IP:5555>
If still not successful, it probably means you will have to pair your device to your machine via adb first. This usually comes on some devices with above commands but if not then,
use adb pair <IP:PORT>
On Device > Developer Options > Wireless Debugging > select Pair device with pairing code
Enter this pairing code on console and device will pair.
Now use adb connect <IP:PORT>
Also note, You don't need USB debugging on or any cable connections first and TCPIP configuring with this way.
In my case just restarting the device worked. Just try if you are lucky!
[Dec-2022] I suffered from this problem around 2-3 months.
I tried all the cmd way but my device(Android 12) was not connecting wirelessly. As my laptop & mobile was both connected 5 ghz connection of my router.
After switching my mobile to normal 2.4 ghz wifi network. it connected with adb connect {ip-of-device} !!
So, if your wifi network supports both the 2.4 and 5 ghz then try connecting your devices(laptop/mobile) to another combination. Then try to connect with adb connect {ip-of-device}

ADB Wireless + Windows + Non-rooted Device + Hang Issue

I am trying to connect my device via WiFi and following the steps mentioned here.
But when I restart adb in different modes like:
1- adb usb, or
2- adb tcpip 5555
the result is like:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
restarting in TCP mode port: 5555
And it hangs there itself, nothing happens after that.
Is something else needed that I am missing ??
Thanks, if someone read my question and tried for some solution but I found a work-around solution for this:
1. Run the command adb tcpip 5555 and when it hangs, disconnect the USB
2. Connect the USB again, run the command again, now you can see that it proceeds to next input line where you can proceed to adb connect **.**.**.** command to connect to device via tcp.
3. Now, just remove the USB cable and continue using the device.
NOTE: Device and System must be connected to same wireless network.

Can't connect to Android via ADB over wifi - Do I need root access?

I'm basically trying to do this:
How can I connect to Android with ADB over TCP?
with the Droid X2.
I have USB Debugging on, and my phone is plugged in via USB.
The IP Address is 10.0.78.33 (I have verified that I can do TCP communication to the phone on that IP, and I can ping it).
I go to the command line and do the following:
>>adb tcpip 5555
restarting in TCP mode port: 5555
>>adb connect 10.0.78.33:5555
unable to connect to 10.0.78.33:5555
Any thoughts on why this doesn't work? Do I need root access in order to do this? I'm trying to avoid rooting the phone.
Thanks!
Step 1 . Go to Androidsdk\platform-tools on PC/Laptop
Step 2 :
Connect your device via USB and run:
adb kill-server
then run
adb tcpip 5555
you will see below message...
daemon not running. starting it now on port 5037 *
daemon started successfully * restarting in TCP mode port: 5555
Step3:
Now open new CMD window,
Go to Androidsdk\platform-tools
Now run
adb connect xx.xx.xx.xx:5555 (xx.xx.xx.xx is device IP)
Step4: Disconnect your device from USB and it will work as if connected from your Android studio.
Symptoms
With my phone, this problem happens a lot. I get these symptoms:
ping x.x.x.x times out
adb connect x.x.x.x times out ("unable to connect")
telnet x.x.x.x 5555 times out
Workaround
I need to disable and re-enable WiFi on my phone before running adb connect on my computer. Then I can both ping, telnet, and adb connect to the phone.
I'm using a Sony Xperia M C1904 running CyanogenMod 12.1.
Your device hasn't to be rooted. I've developed a plugin for IntelliJ/Android Studio to connect your device over wifi pressing just one button. Here is the code and here the plugin ready to be used.
The usage is quite simple. Here you have a gif:
In my case i need pair device with code.
in phone "For developers" -> "Wifi debug" -> "Connect with code"
adb pair x.x.x.x:xxxxx password
adb connect x.x.x.x:xxxxx
Root IS needed to change that system properties. However, it is not needed to start adb over wifi.
You can forward the ports while connected through USB and then tell the adb daemon to listen over a certain frequency:
ADB over wirless
I've encoutered the same problem, and my device was rooted. The problem actually came from adbd Insecure.
If you installed adbd Insecure on your device, it will prevent you from connecting to your device via WiFi. You have to uncheck the "Enable insecure adbd" in the app adbd Insecure.
See FIXED: Can't connect to adb over wifi
The problem with me for my Samsung Tab 1 was an adb process was already running on port 5037 on my Xubuntu 14.04 machine, which I was unaware about until I typed pgrep -l -u username. To fix this, I terminated the adb process using pkill adb, navigated to my platform tools folder and ran adb tcpip 5037 and then connected to my device using the 5037 port number. Boom! Worked like a charm.
Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as "Unable to connect to device......Same network"
After spending much time i was unbale to resolve the issue.
Then i tried - WIFI ADB ULTIMATE by
https://github.com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin
It worked for me.
I know it's an old thread and OP is asking in very common scenario but I would like to mention what happened with me.
I was able to connect to ADB over wifi through below steps:
connect android phone to computer via USB (critical initial step)
open terminal in android studio & navigate to where the adb is installed
execute command adb tcpip 5555. this will restart the adb in TCP mode port: 5555
execute command adb connect <ip address>
for first time you might need to give access to adb from phone when asked
after connection establishes, you can disconnect the usb cable and you're good to go.
This worked all the time when I'm on my home wifi.
Twist:
I got the error saying failed to connect to '172.16.224.20:5555': Connection refused, when i tried to connect from Starbucks cafe wifi (or any other public wifi).
After some research I realized that
many public wifi has some configuration restrictions which doesn't
allow adb over wifi
.
I couldn't connect adb to my Nexus5 Phone over 5Ghz WLAN but it did work with the slower 2,4 Ghz instantly.
After you run setprop service.adb.tcp.port 5555 and restart adb you won't see the device if you run adb devices on the host.
Instead, you have to run adb connect 10.0.78.33:5555
I hope this will helpful and worked for me
Disconnect phone from studio.
Go to developer options in phone.
Under USB debugging, there is an option to Revoke USB debugging authorisations.
Then click ok.
Then again connect phone to studio via USB.
Then click on connect button in ADB Wifi.
Now you can run and debug apps without USB

Categories

Resources