adb device offline with ADB wireless
Asked Answered
W

25

25

For some reasons, my phone does not work anymore with cable.

I saw on the Internet that it is possible to connect adb to the via Wifi, however I tried it and I get this:

adb devices
List of devices attached
192.168.1.2:5555        offline

I search this on Google and it seems that it is related to Android 4.2.2. And indeed, my device is running Android 4.2.2.

I didn't find any answers on Google for my problem since it is always with a cable, mine is on Wifi...

Any idea how to solve this?

Warmhearted answered 13/7, 2013 at 3:27 Comment(1)
This answer may helps you. If your phone is 8.0 system too.Trill
R
47

For me the complete steps that worked were :

  • Settings -> Developer options -> Revoke USB debugging authorizations (clear the list of authorized PCs).

  • Set USB Debugging OFF.

  • In Terminal write : adb kill-server

  • Then : adb start-server

  • Then : adb connect xx.xx.xx.xx:5555 (the devices ip), it should say unable to connect.

  • Now turn ON USB debugging again and type the adb connect xx.xx.xx.xx:5555 again.

    It should now ask for authorization and you are back online without needing to connect cable to USB, only wifi used.

Rafflesia answered 18/3, 2016 at 9:40 Comment(5)
The key for me was to turn off usb debugging, then turn it back on. This seems necessary if switching between computersCaracul
this is true for meHarslet
I was using an old version of ADB, I went to the official website and downloaded the latest version of the platform-tools and everything went smoothly.Hypersthene
Killing and starting the server worked for me.Memling
Sadly all of this proved necessary for me, thank youIncongruous
B
11

run adb kill-server, then try to connect wirelessly again. It worked for me.

Basiliabasilian answered 5/8, 2015 at 16:12 Comment(1)
thanks!! it help for me to trigger the message on the phone "Allow USB debugging?" that was in "offline" mode in adb devices, and in Android-StudioCarnauba
P
10

I could not find exact solution for this problem too. Best way worked for me was disconnecting device from wifi, then try to connect while device is not connected to Wifi like:

adb connect 192.168.55.3:5555

this causes adb waiting for connection. immediately connect device to wifi and adb will detect device and connect again. hope this helps.

Pga answered 2/2, 2017 at 9:35 Comment(0)
L
5

Disconnect adb over wifi, connect your phone with a USB-cable to your pc. It will ask you on your phone is you want to allow the connection. Tick always allow. You will only get this when you connect with USB and have to do this only once, you can use over wifi afterwards. Don't get the pop-up? Try the answers on google over a cable, since you need to do this first.

Lange answered 21/7, 2013 at 21:25 Comment(2)
I can't do that... The reason I want to connect over wifi is because my phone USB plug is broken down, it cannot be used anymore.Warmhearted
That was the only solution I found to trigger the pop-up over wifi for me unfortunatelyLange
C
4

It seems you want authenticate adb over wifi.If you had your device rooted,you can try this way.

  • Copy ~/.android/adb_key.pub to your android device,and rename it to adb_keys

  • Move it to your /data/misc/adb/

  • Reboot your android,then reconnect over wifi.

Control answered 29/4, 2015 at 0:36 Comment(2)
if you have root access, you need no reboot, just do: adb shell su 0 setprop ctl.restart adbdCarvey
With this I can allow adb connect to VirtualBox android-x86 CM13. Usual connect do not show any prompt on android device.Ogdan
H
3

For the first time in debug mode, you need to Authorize your phone with the PC, and that requires the USB cable. After that you can use Debug over WIFI.

If you want to force your phone to show the Authorization message box, simply delete the below file.

/data/misc/adb/adb_key
Hendon answered 6/11, 2014 at 4:26 Comment(0)
P
3
  1. In android studio go to Preferences->Plugins
  2. Download and install this plugin ADB WIFI Connect , restart Android Studio
  3. Connect phone via USB
  4. In android terminal use command: adb devicesyou should get visible device connected via USB:
List of devices attached

988a57334e57365058      device
  1. Click on plugin icon in android studio AndroidWiFiADB
  2. If phone get connected properly via WiFI, you see in event log:

12:41 Android WiFi ADB: Device 'ModelOfYourPhone' connected.

  1. In android terminal use command: adb devices use should get
List of devices attached
988a57334e57365058      device
192.168.60.101:5555     device
  1. Disconnect USB cable and re-check again adb devices, should remain only device connected via wifi:
List of devices attached
192.168.60.101:5555     device
Parker answered 24/9, 2018 at 16:36 Comment(1)
For android studio 3.2.1, UI of "Plugins" is moved to "Files -> Settings -> Plugins"Paganini
E
3

I solve this problem for huawei P10. its about phone's developer settings => find usb developer settings, and under usb developer setting there is a "adb debugging in charging mode..." enable it. My problem solved with this way. Hope yours too....

Endodermis answered 18/2, 2021 at 14:23 Comment(2)
This works also in my Samsung A12Waterproof
Works on Huawei Honor 8X.Vange
P
2

Try disconnecting your device with:

abd disconnect <IP/TCP>:<port>

Then restart the WiFi connection of your device, and reconnect your device with:

abd connect <IP/TCP>:<port>

That may fix it; it worked for me.

Police answered 22/3, 2015 at 19:35 Comment(0)
M
2

For me, the important part turned out to be the following line adb tcpip 5555 together with using the port in the IP of my phone like so: adb connect 192.168.1.87:5555 (only using one of them, did not work, i.e: writing the second alone didn't work, writing the first and then excluding the port in the IP also didn't work). The adb tcpip 5555 line is not mentioned anywhere here. So, for me, the PORT needed to be both manually set and used in the connect line!

These are the events of my command line in Windows PowerShell Admin to demonstrate (Wifi on and debug mode on and confirmed permission when the popup came):

notice that the connection first failed, then it said it was connected which is weird behavior to begin with (no matter what, it always failed once and "succeeded" once), and in both instances, the device showed as offline. The disconnect commands also confirm that its 110% offline

PS C:\WINDOWS\system32> adb kill-server
PS C:\WINDOWS\system32> adb start-server
error: protocol fault (couldn't read status): Connection reset by peer
PS C:\WINDOWS\system32> adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
PS C:\WINDOWS\system32> adb connect 192.168.1.87:5555
failed to connect to 192.168.1.87:5555
PS C:\WINDOWS\system32> adb devices
List of devices attached
220947272e047ece        device
192.168.1.87:5555       offline

PS C:\WINDOWS\system32> adb connect 192.168.1.87:5555
already connected to 192.168.1.87:5555
PS C:\WINDOWS\system32> adb devices
List of devices attached
220947272e047ece        device
192.168.1.87:5555       offline

PS C:\WINDOWS\system32> adb disconnect 192.168.1.87:5555
error: no such device '192.168.1.87:5555'
PS C:\WINDOWS\system32> adb disconnect 192.168.1.87:5555
error: no such device '192.168.1.87:5555'
PS C:\WINDOWS\system32> adb tcpip 5555
restarting in TCP mode port: 5555
PS C:\WINDOWS\system32> adb disconnect 192.168.1.87:5555
error: no such device '192.168.1.87:5555'
PS C:\WINDOWS\system32> adb connect 192.168.1.87:5555
connected to 192.168.1.87:5555
PS C:\WINDOWS\system32> adb devices
List of devices attached
220947272e047ece        device
192.168.1.87:5555       device

As soon as I added the adb tcpip 5555 command and it restarted in TCP mode port: 5555 the adb connect 192.168.1.87:5555 command worked!

Metacarpal answered 23/11, 2018 at 23:14 Comment(0)
H
2

Make sure that pc is authorized in the device by going to Developer options -> Revoke USB debugging authorisations and then trying to connect via USB. After accepting the PC, disconnect the cable and connect through wifi.

adb kill-server
adb run-server
adb connect IP:5555

Although in my case, when I tried to connect it failed at first and second try it said already connected.

I disconnected from the device and connected again and it solved.

adb disconnect ip:5555
adb connect ip:5555
Haemolysin answered 2/3, 2019 at 7:6 Comment(0)
F
1

My solution steps:

  1. Turn Off WiFi and Turn it back On again.
  2. Settings -> Developer options -> Revoke USB debugging authorizations.
  3. Settings -> Developer options -> Turn Off ADB over network and turn it back On again.
  4. adb kill-server
  5. adb start-server
  6. adb connect xx.xx.xx.xx:5555

Note: Step 3 was the key for me. don't forget it.

Foreshadow answered 23/6, 2017 at 10:23 Comment(0)
I
1

In simple cases it will start after Enabling USB debugging

For complexities you need to delete the

adbkey

file from

C/.android and then running following commands in command prompt

adb kill-server 
adb start-server 
adb devices
Isoelectronic answered 15/5, 2019 at 8:52 Comment(0)
M
0

Note that wireless adb connectivity in Android 6.0.0 is broken. Updating to 6.0.1 fixes the issue.

https://mcmap.net/q/262844/-adb-wifi-connection-with-android-6-0

Metametabel answered 12/1, 2016 at 7:33 Comment(0)
O
0

In Windows, if you are using system-wide proxy software like Proxifier, you need to add adb.exe to the ingore list or direct-mode list. In my case, using Proxifier will make adb able to connect to any IP address even when the phone is not connected to the WiFi, and this leads to device offline.

Orianna answered 8/11, 2016 at 4:0 Comment(0)
C
0

I know its late to answer but I believe this is the exact answer:

go to WIFI setting on your device and "set a new IP" in your network IP range an reconnect.

Corcovado answered 6/4, 2017 at 12:53 Comment(0)
M
0

Conflicting ADB connections can cause this issue as well:

Windows Host with Docker to Hyper-V Android x86 emulator

I didn't see this answer here yet so for those attempting something similar, the issue I had was that the local Windows Host ADB process had already acquired the adb connection during start up (adb server start).

By simply running: adb disconnect <Device/Android x86 Hyper-V ip>:5555 on host machine

Running adb connect <Device/Android x86 Hyper-V ip>:5555 on the Docker container was able to successfully acquire the remote device (aka Android x86 Hyper-V)

IMPORTANT!!! Until you disconnect Docker (or whatever), your host machine (or any others) will not be able to connect, apparently only one ADB connection at a time is allowed.

I didn't need to do anything else listed above. Hope this helps others.

Morey answered 29/4, 2017 at 16:44 Comment(0)
S
0

Just turn off your Proxifier or something else like this.

Socks5 works fine

Saleme answered 15/8, 2017 at 10:22 Comment(1)
WHY THE BIG LETTERS??Gerdi
G
0

I have this problem just now. Note that my case is special, the usb has been disabled for security concerns. Reboot not working. This is not ip problem since ping is working and nmap shows 5555 port is open. Also since I will not able to connect if port is wrong, so nothing to do with port.

There are 4 reasons:

  1. Because another pc in the local network already connected, so the other guy have to adb disconnect first, then I can do adb disconnect and adb connect <ip>, since only one person can connect at the same time.

  2. A hotspot ssid name might consists of multiple bssids in (especially you're in office) local network, so you need to ensure your pc try all the hotspot bssids which match the android connected hotspot bssid. Note that I noticed it's not always the case (Now I tried different bssids still success), but it did solved before.

  3. Ensure the port 5555 is open correctly. Even though there are many ways, but you can download this app to open port 5555.

  4. And I just encounter a weird case, client A connect just fine. But then client B turn on wifi and attempt to connect but failed. Then this failure causes original client A no longer able to connect. Reboot device/adb disconnect/adb kill-server doesn't help, and confirmed the ip is same(tested by turn off/on device and observe the ping). I make a joke about client B wifi still turn on may interfere the device wifi. Then I realized Client B disconnect/kill-server is not enough, client B also need turn off wifi to make client A connect. And it did.

Gussi answered 5/2, 2018 at 9:54 Comment(0)
M
0

Watever! I'm always using these steps to connect ADB Wifi with android studio

STEP-1: 1. Go to Android studio->Settings-> Plugins -> Search ADB WIFI 2. Install the pluging and restart android studio

STEP-2: 1. Find the location of SDK Manager For ex for my computer enter image description here

  1. Copy the whole location
  2. Now open Terminal in Android studio itself( This will show in right bottom corner).
  3. type cd YOUR_SDK_LOCATION
  4. type cd platform-tools
  5. Now type adb tcpip 5555

FOR NEXT STEP YOU MUST CONNECT YOUR MOBILE AND LAPTOP WITH SAME WIFI

  1. type adb connect 192.168.6.100:5555 in terminal (Here 192.168.6.100 is your mobile IP Address)

now the message will show like this 'connected to 192. 168.6.100:5555'

STEP -3 : 1.Go to Android studio->Tools->ADB WIFI-> ADB Restart 1.Go to Android studio->Tools->ADB WIFI-> ADB USB to WIFI

Like below

enter image description here

That's it .

Maybe answered 29/3, 2019 at 5:7 Comment(0)
B
0

In My case my wifi network is not same thats why i am not getting connected with the device.

There is very easy and helpful plugin for this purpose Android Wifi ADB

How to Connect using plugin:

  1. connect device using cable
  2. click on Android wifi adb icon
  3. disconnect your USB connection now your device is connected over wifi.

Enjoy Happy debugging.

Between answered 5/4, 2019 at 7:48 Comment(0)
G
0
  1. adb reconnect offline
  2. adb connect [ip]:[port] (for exemple adb connect 192.168.8.100:44
Grozny answered 24/3, 2020 at 12:22 Comment(0)
D
0

While all tips with killing ADB server helped me many times, now I got the message:

cannot connect to <IP>:<port>: No connection could be made because the target machine actively refused it. (10061)

It was possible to attach the device only while it was connected with USB, and after disconnecting cable it appeared as offline at the attached devices list.

I have just solved my problem by changing the USB configuration:

Developer options > Select USB Configuration: MTP (Media Transfer Protocol)

PTP (Picture Transfer Protocol) works as well.

Screenshot

I hope it will help.

Demetrademetre answered 6/4, 2020 at 18:26 Comment(0)
A
0

Try,
adb disconnect <your_ip_address>:port_number or adb disconnect

eg.
adb disconnect 192.168.1.2:5555

Or
adb disconnect

The difference is that first one will disconnect only the required device, the second one will disconnect all the devices.

The benefit of using this command is that you don't have to kill and restart the server. Killing and restarting the server requires your device to be plugged in to your computer which is most irritating process.

Ambrosia answered 19/3, 2021 at 20:12 Comment(0)
J
0

For me the reason is GLOBAL PROXY (A country without international internet). Adb try to connect my device through proxy server.

Jocundity answered 11/8, 2021 at 13:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.