I am trying to sideload a build to my phone, Alcatel Android 7. I have been able to sideload to it before but it's stopped working when I switched to a new network. I am running it from MacOS terminal.
Courtneys-MacBook-Pro-3:~ courtneytaniguchi$ adb connect 10.0.0.216
failed to connect to '10.0.0.216:5555': Connection refused
Courtneys-MacBook-Pro-3:~ courtneytaniguchi$
This phone is developer enabled, I have allowed installation of apps from unknown sources turned on in security, and USB debugging is on too. Yes, I am on the same network.
I had a similar problem failed to connect to '192.168.31.84:5555': Connection refused, final worked by:
kill and restart adb
adb kill-server
adb start-server
makesure USB wired connected
adb devices can see your device id
re-config to tcpip mode: adb tcpip 5555
Note: for multiple USB connected devices, should specify device serial id:
adb -s device_serial_id tcpip 5555
connect to you device via WiFi: adb connect your_android_phone_ip:5555
Full log for your refer:
adb kill-server
adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb devices
List of devices attached
2e2a0cb1 device
orga4pmzee4ts47t device
adb tcpip 5555
error: more than one device/emulator
adb -s 2e2a0cb1 tcpip 5555
restarting in TCP mode port: 5555
adb connect 192.168.31.84:5555
connected to 192.168.31.84:5555
Based on the commands you are entering it seems you are trying to do adb over wifi.
The following may help:
Rebooting the phone
Ensuring the phone is listening over TCP/IP by connecting to it via the USB and entering adb tcpip 5555
Turning USB debugging off and on again
I had the same error. Solved by following extra steps mentioned here which is connecting the device via USB and then executing the following command after finding device id :
./adb -s <device id> tcpip 5555
If you are stuck in the sideloading process, you can always e-mail the .apk file to yourself at an e-mail address which is configured on the phone, download the attachment, then go to 'downloads' app, and click on the .apk file, it should ask if you are sure you want to install the app, just say yes. You have to make sure that you have already selected 'Allow' in the Unknown Sources section in Settings/Development.
Same happened with me. Always rejected, I have two devices used to connect over wifi for some Android Project, im always rejected to 5555 on my Huawei Device. But there is one workaround i know that works.
➜ ~ adb connect 192.168.8.108:5555
failed to connect to '192.168.8.108:5555': Connection refused
➜ ~ adb connect 192.168.8.108:7612
connected to 192.168.8.108:7612
Try port 7612
Thanks!
Related
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.
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}
I used to be able to setup wireless ADB no problem (plug in, adb tcpip 5555, adb connect ), now it gets stuck indefinitely during the "adb tcpip 5555" command. Wired adb still works fine, so does setting up wireless ADB through apps in play store, just not via cmd. Between wireless working and now not working, I did a bunch of things so any of them may or may not be the problem:
1) Reformatted computer (Same OS)
2) Redownloaded the SDK needed for Android Development
3) Went from ParanoidAndroid to GPE on my HTC One.
Anyone have any idea what the problem is?
You can emulate what apps do with these steps on your device with root and android terminal emulator:
$ adbd stop
$ setprop service.adb.tcp.port 5555
$ adbd start
Then use adb connect XXX.XXX.XXX.XXX where XXX.XXX.XXX.XXX is your ip address found from:
$ ifconfig wlan0 | awk '/inet addr/ {print $2}' | cut -d: -f2
You can check if your connection is establed using netstat | grep 5555. You should see a tcp entry with your ip address and port for adb connectivity.
If your device is rooted then it is very simple to establish a wireless connection, you don't even need a USB cable. Download this app from Google Play https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=en
It worked for me at least, and as can be seen from the app rating it works for almost all.
-----Enter the command adb kill-server at command prompt-----
C:>adb kill-server
-----Enter the command adb devices-----
C:>adb devices
List of devices attached
daemon not running; starting now at tcp:5037
daemon started successfully
DeviceID device
-----DeviceID is the unique ID of connected device-----
-----Enter the command adb tcpip 5555-----
C:>adb tcpip 5555
restarting in TCP mode port: 5555
-----will see the response as given above -----
-----Enter the command adb connect 1.1.2.2-----
-----1.1.2.2 is the mobile device IP-----
C:>adb connect 1.1.2.2
connected to 1.1.2.2:5555
-----will see the response as given above -----
-----Now u can use 1.1.2.2:5555 ID as wireless to connect device-----
Trying to configure ADB so that I can debug it via wifi, I have checked on Google but not getting proper resolution.
Tell me what to enter in port address, device ip.
Moreover setprop service.adb.tcp.port command is running when i give space between set and prop, bit confuse...
Seeking for help
I got the following article, and wanted help in the same context.
disconnect device from usb then tell it to listen on 4455
adb tcpip 4455
restarting in TCP mode port: 4455
connect to the device using a specified ip:port. my device is using wifi
adb connect 192.168.1.103:4455
connected to 192.168.1.103:4455
now do normal adb commands over tcp
adb shell
when your done, you can put it back in USB mode
adb usb
restarting in USB mode
Help me
These are commands for the shell of the android device, not for the host system.
Type adb shell to get the device's shell and then enter them. If you get back to the windows shell prompt you are in the wrong place.
However those commands may not be effective on a secured device anyway.
setprop is an Android command and is meant to be used in a terminal after su on the device (you can do adb shell setprop ... but when you adb shell stop adbd you'll loose your device connection). The easier way if already connected via USB is adb tcpip 8600 and then adb connect IP_OF_PHONE:8600 -- but this will only work if adb shell will get you a root prompt (starts with # and not $). Be aware that anyone on your wifi network can access your device!
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