396

I can't connect to my device anymore using ADB through the command line or in Eclipse.

Running the command

adb devices

returns the device name, but it says it's offline.

Things I've tried.

  1. Toggled Android debugging mode
  2. Reinstalled the Google USB driver
  3. Restored the OS to a previously working backup (CyanogenMod)
  4. Swapped the USB cord
  5. Rebooted the phone/computer multiple times
  6. Updated the Android SDK

I really don't have any clue what's going on. Anything else you think I can try, I'm all ears.

To be clear, if you're having this same issue the problem is probably an out-of-date SDK. As of 4.2.2 there is a security feature that requires you to confirm the RSA fingerprint of the connecting device. Open the SDK manager and update the tools! Then reboot.

13
  • 38
    try another usb port.
    – jayellos
    Commented Feb 21, 2013 at 3:19
  • 4
    I also encountered this kind of problem. What i did was, *issue command adb kill-server, adb start-server. *try another USB port, mostly it will work in the back of the PC., *restart the device, *restart eclipse, *restart computer, *change USB cord some USB cord will fail(low quality). Lastly if problem not solved, re-install Device USB Driver.
    – jayellos
    Commented Feb 21, 2013 at 3:39
  • 1
    rebooting my device also worked (4.0.4)
    – phyatt
    Commented Mar 20, 2014 at 22:19
  • 4
    It happened same to me. For my case, I just disable the Developer option and then re-enable. That is it. Commented May 11, 2014 at 13:58
  • 1
    The thing that fixed it for me was to upgrade the SDK platform-tools to r16.0.1. For me, this version was not displayed in my SDK Manager, so I pulled it down from dl.google.com/android/repository/… directly. You then need to rename the platform-tools directory and unzip it to android-sdk-windows/platform-tools. Using the SDK Manager, I had also updated to the latest sdk-tools before this. If your whole Eclipse and ADT are ancient, you may need to update them as well, but I didn't need to. Commented Aug 6, 2021 at 6:07

69 Answers 69

210

Just kill the server adb kill-server

7
  • 1
    Works if your drivers are already upto date and still getting a problem. In other cases too, it may work I think.
    – kAmol
    Commented May 12, 2015 at 9:18
  • 1
    adb start-server after that
    – madz
    Commented Jul 6, 2016 at 16:08
  • 1
    I must have missed the 'allow USB debugging from xx:xx:xx' on the phone. Restarting the server and reconnecting USB popped it up again.
    – Dan Bolser
    Commented Dec 17, 2017 at 22:03
  • 1
    adb kill-server did remove all my additional offline devices and problem solved Commented Mar 21, 2018 at 7:19
  • 1
    To ensure I'm running the correct version of adb I navigate to the folder with AndroidStudio installed, and then to platform-platform tools. Thus, for me, C:\Users\myuseraccount\AppData\Local\Android\Sdk\platform-tools. Then I run adb commands with the prefix ./adb to ensure the command is not picked up from elsewhere in Windows, eg. ./adb kill-server. After that, your solution worked, and I got the security question on my device. Commented Jul 1, 2020 at 7:30
147

I just got the same problem today after my Nexus 7 and Galaxy Nexus were updated to Android 4.2.2.

The thing that fixed it for me was to upgrade the SDK platform-tools to r16.0.1. For me, this version was not displayed in my SDK Manager, so I pulled it down from http://dl.google.com/android/repository/platform-tools_r16.0.1-windows.zip directly.

You then need to rename the platform-tools directory and unzip it to android-sdk-windows/platform-tools. Using the SDK Manager, I had also updated to the latest sdk-tools before this.

If your whole Eclipse and ADT are ancient, you may need to update them as well, but I didn't need to.

Note: you may need to run SDK Manager twice (once to update itself) before you will see the latest packages.

15
  • 1
    I have r17 but I get the same problem. Will reverting to r16.0.1 help? Commented Jun 29, 2013 at 7:46
  • @spartacus I don't think so I would think that the problem for you may lie now elsewhere.
    – hack_on
    Commented Jun 29, 2013 at 8:07
  • Solved, problem caused by missing platform of Android SDK
    – Tai Dao
    Commented Jul 25, 2013 at 4:41
  • Worked exactly in the order described. Final step is to allow it on the phone.
    – vlad
    Commented Nov 30, 2013 at 5:17
  • 32
    Just reboot the phone or device and enjoy, no need to re-start adb nothing else. Commented Dec 29, 2013 at 10:36
89

It also seems to occur frequently when you connect to the device using the Wi-Fi mode (in Android Studio or in the console by running adb tcpip 5555 for example).

To fix:

  1. Disconnect the USB connection—or turn off the device's Wi-Fi if you're connected over Wi-Fi.
  2. Close Android Studio/Eclipse/other IDE.
  3. Run adb kill-server to ensure adb is not running.
  4. Restart your Android device.
  5. After your device restarts, connect it via USB and run adb devices. This should start the ADB daemon. Your device should now be online again.
4
  • 2
    Step 3 is most probably the key solution here! close your command line interface and kill the process if it is still running and Try again!
    – reubenjohn
    Commented Feb 14, 2014 at 9:53
  • This works for me (Galaxy Tab GT P7500 with windows 7)
    – Sarvan
    Commented Mar 2, 2015 at 13:08
  • Worked for me with Android 8.0 and Windows 10
    – andoni90
    Commented Nov 30, 2017 at 12:05
  • I tried the adb kill-server without the Android device restart and it didn't work. When I repeat these steps and restart the device as mentioned in section 4, it worked.
    – E235
    Commented Feb 10, 2019 at 7:25
65

I can't stress it enough that switching USB ports is key. Often front panel USB ports can be defective.

7
  • 6
    Worked for me too. Nexus 10 sometimes seem to draw too much current for the USB port
    – skubo
    Commented Dec 16, 2013 at 12:59
  • 1
    Wow, after 1/2 hour of dead ends, this it turns out that this is USB powering issue! Thanks!
    – bigjosh
    Commented Mar 14, 2016 at 0:27
  • Sometimes it's not a defective port. In my case I had the USB plugged during Windows boot and it didn't load the ADB drivers correctly. Just unplugged and plugged again in the same port. Windows wonders... Commented Jun 14, 2016 at 13:48
  • 2
    Sometimes switching ports works. Sometimes it's a matter of USB2 vs USB3 support from the various ports + cable + device combinations. Switching from front to back ports, or ones with or without the "SS" indicator (USB3) sometimes helps. Trying a different cable sometimes helps.
    – Jon Adams
    Commented Jul 29, 2016 at 19:03
  • 8 hours wasted for me. It works on USB 3.0 but not on USB 2.0 for some reason (for me at least). Never had that issue till now and all the sudden I have to use 3.0. Which is wasting one of my 3.0 ports now.
    – Ryan
    Commented Mar 16, 2017 at 21:49
64

I hit the same issue on a Nexus 7 running 4.2.2 OTA update. I'm almost certain I had an ADB connection over USB and Wi-Fi after the update until it just stopped working. To fix, I updated my SDK using:

android update sdk --no-ui

Now my development tools are:

  • SDK rev 16.0.2
  • SDK tools rev 21.1
  • SDK API 17, rev 2
6
  • 1
    "'android' is not recognized as an internal or external command, operable program or batch file." -- also did a "dir android.exe /s" from the root of my C: drive -- found nothing -- are you using Linux, or do you have some special bits that us Windows users don't have? Commented Nov 4, 2013 at 0:03
  • Yes, I use linux. android is a shell script under ./sdk/tools/ that kicks off the android SDK Manager java app. There must be a comparable script in the Windows SDK tarball.
    – dturvene
    Commented Nov 8, 2013 at 22:29
  • 7
    the command given can be used on windows as long as it is done from your path\to\android-sdk\tools\ directory
    – gadget
    Commented Nov 11, 2013 at 21:14
  • 4
    In Windows 7, to issue the command from the ...\android-sdk\tools\ directory and have it work, run the command window "As Administrator". Commented Dec 26, 2013 at 2:04
  • It worked for me with Nexus 10 and Galaxy Nexus. I am using Windows XP SP3. I tried changing usb port, restarts, etx.. nothing helped but this answer. I was almost going to reinstall xp, thanks!
    – Fer
    Commented Mar 25, 2015 at 8:42
41

For anyone wondering about 4.2.2, there is a security question that appears on the phone requesting RSA verification with the PC. Be sure your tools are updated AND you allow the PC access by verifying the security question on the devices in question. This fixed it for me.

And as always, verify you have debugging enabled in the developer options ;)

1
  • 9
    It worked for me once I revoked the usb debugging authorizations. Then disabled and reenabled usb debugging. The "allow this computer" message popped up, and BAM, it showed as device instead of offline. Commented Dec 13, 2013 at 2:07
27

Try by turning off usb debugging once and then enabling it agin and then connect your device with system: link

3
  • 4
    This certainly is the simplest, surest, and quickest method. I used many variations of all the methods in this thread. This is the only one that works every time. It's just three taps on the android device and the issue is gone. Commented Mar 8, 2017 at 5:45
  • This was the only method that worked for me, combined with revoking USB debugging authorizations.
    – Lajos Nagy
    Commented Jul 5, 2021 at 18:12
  • My device offline problem appeared after I performed kill of adb processes. This is also for me the only method that helped. Commented Sep 19, 2023 at 11:12
22

Multiple adb.exe files ?

My problem was solved when deleted a copy of OLD adb.exe from C:/Windows/. I don't know how a copy of adb.exe got to the C:\Windows\ ?

When I launch adb.exe from android-sdk/platform-tools/ I had no problem with detection.

8
  • This is what happened with me. I think something I downloaded to install a ROM two years ago was the culprit.
    – gengkev
    Commented Apr 5, 2014 at 23:19
  • My Windows 8 had the same issue and renaming the c:\windows\adb.exe to something else (adb.old.exe) fixed the problem. I didn't even need to reboot or open/close the command line. It just works. I typed adb devices right after renaming the old adb.exe and then my Nexus 7 asked if I want to authorize this computer. I said yes and now when I issue adb devices instead of "offline" it says "device".
    – AlexStack
    Commented May 21, 2014 at 20:31
  • 1
    Thanks, this one works! Same thing happened to me also, I think adb.exe get copied to C:\Windows when we installed the driver software that came with the device.
    – thinzar00
    Commented Jul 8, 2014 at 2:55
  • How did it get there though :/ I want to know Commented Sep 7, 2015 at 14:57
  • 1
    @DanielCheung For me it was when installing the KingORoot and/or the KingRoot pc programs. I guess they install a version themselves because they don't rely on the user having the Android SDK installed. And yeah, deleting the old (1.0.26) version it creates from the Windows directory fixed the "offline" issue for me. : )
    – Venryx
    Commented Dec 28, 2016 at 6:51
21

If your device normally connects over USB, but suddenly stops working, especially after the USB cable has been disconnected and reconnected, try the following non-invasive steps before doing some of the more drastic things mentioned in the other answers:

adb kill-server
adb start-server
adb devices

If your device is listed with 'device' next to it, you're back in business.

If your device is listed with 'offline' next to it, try restarting the device. The ADB daemon on the device will occasionally get hung. I've noticed this more when I've disconnected the cable while LogCat is running and after switching back from connecting via Wi-Fi or Ethernet.

If your device isn't listed then you should try the solutions in the other answers, starting with trying a different USB cable and port. Those cheapo cables can go bad.

5
  • That helped solving my problem (android emulator was showing up as 'off-line' but after restarting server as described it was back in 'device' mode).
    – Greg0ry
    Commented Mar 2, 2014 at 15:30
  • 2
    After many hours of trying to find the reason why adb does not work anymore, it was in fact the cable!
    – Martin L.
    Commented Jun 25, 2014 at 13:19
  • I've been bitten by a bad cable more than once. The bad cables would usually still charge the device fine, so I too have wasted a lot of time before trying different ones.
    – scottt
    Commented Jun 26, 2014 at 2:43
  • Oh my god, I’ve tried all the solutions, but the simplest one—to reboot THE PHONE—didn���t come to my mind. That solved my problem. Commented Sep 4, 2015 at 15:52
  • I had to use a shorter cable - the one I use to charge my phone was too long! Commented Jul 5, 2017 at 15:38
19

I was having this problem and none of the other answers helped. What was necessary, after updating the SDK and installing the API for 4.2.2, was running:

android update adb

Another problem I was having was that I was trying to connect ADB over Wi-Fi, which is my only option because the USB ports on my Mac are really finnicky. Unfortunately, ADB over Wi-Fi doesn't show the security question in 4.2.2, so you need to find a USB cable that'll work and connect over USB at least once to accept the security question, but after you do that once, you can connect over Wi-Fi.

3
  • This did it for me. Thanks. Was bashing my head against a wall since updating my Nexus 7. Commented Jul 8, 2013 at 17:46
  • I tried everything on this page and a few other sites that Google turned up and my HTC phone running Android 4.0.3 still was being listed as offline. I finally restarted the phone and then adb devices said it was online. Man, I wish I had thought of that earlier. Commented Jan 2, 2014 at 22:49
  • I got this error: device offline until I found your comment about wifi - as soon as I took my phone off wifi it worked. Thanks!
    – amurrell
    Commented Dec 6, 2014 at 1:55
13

Be sure to use adb from your platform-tools folder, after updating the SDK tools.

I finally got this working after I realized I was using an outdated version of ADB copied in /usr/bin.

1
  • where is this usr/bin?
    – AnaCS
    Commented Apr 12, 2019 at 8:22
12

I stumbled upon this question while trying to connect using the built in "Wireless ADB" feature present in Android 11.

I couldn't get it to connect properly. Always appeared as "offline".

What I did was following:

Firstly disconnect all ADB devices, just as a good measure:

adb disconnect

Then in the developer options, get into the "Wireless ADB" feature, if you're not already there yet. Go to "Pair using PIN" or similar. There, a IP and port will pop up in a dialog, together with a pin. Connect to the phone using:

adb pair 192.168.2.xxx:42838 # Put the IP and port of that dialog in this way

(Note that the port on the main window and on the PIN popup is NOT the same)

Your (PC) ADB will prompt you for a pin. Type it in and press ENTER.

Done that, the PIN popup on the phone should vanish and the computer name should show up in the trusted device list in the main window.

If you come this far, the next step will certainly work. Try to now connect to your phone using:

adb connect 192.168.2.xxx:53548 # This time use the port shown in the main window!

It should connect and you're good to go.

1
11

I ran to through same problem this fixed for me. connect your phone via usb first then make sure you check your mobile ip which is under settings >> about phone >> status run the following commands.


adb kill-server
adb start-server
adb tcpip 5555 //it resets port so put port you want to connect
adb connect 192.168.1.30:5555 //ip:port of your mobile to connect
adb devices //you will be connected over wifi

1
  • adb tcpip 5555 not reset port it just set a default port for current device and should take place after connecting to a device and next time when you connect to a device via ip address even on wifi network it doesn't need port Commented Aug 18, 2019 at 5:19
9

Sometime this may happen because of adb server error (i think). It always saying

"device-name is offline" from adb devices command.

Just kill server and start again. It worked for me.

"adb kill-server"
"adb start-server"
0
8

I used adb connect <device_ip> and non of the other solutions worked because my problem was on the other side. On the device I needed to stop adbd and restart it start adbd. Device is now "online" again.

1
  • 2
    Had an Amazon Fire TV Stick that had this issue connecting over Wifi. Toggling adb off and on again, adb kill-server, adb start-server, then adb connect <device_ip> as suggested above worked for me.
    – chenware
    Commented Jul 5, 2016 at 17:41
6

I tried dturvene and all the other solutions, but they didn't work. I needed one more step.

Run these commands

  1. adb kill-server
  2. android update sdk --no-ui
  3. adb start-server

To verify that it worked, run 'adb version' before and after the commands and make sure it is the latest. The reason for the adb kill-server command is that it it most likely running, and it can't be updated while it is running, so you have to kill it first.

0
6

Installed the latest android sdk.
Changed the USB port of the device.
Changed from MTP -> Charge only -> MTP.
It worked.

1
  • 2
    For me, changing from 'Transferring media files' to 'Transferring images' (which is PTP/MTP) fixed the issue (after trying all other fixes, including upgrading Android SDKs, using different cables, restarting ADB, cycling developer mode, unplugging/replugging USB into different ports, etc). Annoyingly this answer had 0 score and was on second page when I was looking for an answer, so voting up to try and help others in future. Commented Oct 1, 2016 at 16:06
5

For me nothing worked. I spent about 12 hours constantly searching on the Internet and trying the solutions that worked for other people having similar issues.

Finally I ended up with just doing the ADB stuff over the LAN. The setting was right next to the USB Debug setting and in ADB it can be activated with "adb connect [IPADDRESS]:[PORT]". The port was 5555 on my phone.

I hope this helps someone to get back to work instead of having to deal with constant drawbacks.

5

One more possibility for people with flaky ADB connections, and if they're on a Mac and have Android File Transfer installed: I found that file transfer was interfering with my ADB connection, causing it to stop working intermittently.

Killing the Android File Transfer Agent.app process that looks for compatible devices (for example, the Nexus 7) being connected to the Mac cures the flakiness for me.

1
  • 2
    This was what was causing the problem for me on OS X, thanks!
    – adaam
    Commented Oct 1, 2015 at 19:38
5

This approach worked for me:

  1. adb kill-server
  2. Disable the offline device in Device Manager (see image below)
  3. Enable the device in Device Manager
  4. adb start-server

Device Manager, "View" menu, "Devices by Connection":

enter image description here

4

I initially encountered the same problem (with ADB/fastboot downloaded from GitHub), but I eventually got it to work. What worked for me:

  • Android SDK. ADB version: 1.0.31
  • Using the front USB port (MacBook Pro 15")
  • Restarting the phone after enabling Dev options and USB debugging (do so by 7x tap on settings > about phone > build).
  • Kill adb server in case no device is listed (adb kill-server)
  • The debug icon should be visible on the phone.
  • Be sure to unlock lock-screen to check for the RSA fingerprint confirmation dialog.
4

I have a dodgy USB connection so I tried to get wifi connectivity going. Tried basically everything here, but one thing I did not try until last, and suddenly it worked! So, if you end up stuck, try these steps:

 1. Connect with USB cord
 2. adb devices
List of devices attached
HT85X1A00342    device
10.0.0.43:5555  offline

 3. adb usb
restarting in USB mode

 4. adb reconnect
reconnecting HT85X1A00342 [device]

 5. adb tcpip 5555
restarting in TCP mode port: 5555

 6. adb devices
List of devices attached

 7. adb connect 10.0.0.43:5555
connected to 10.0.0.43:5555

Sweet! I don't know exactly if forcing it to restart USB mode then TCP/IP in sequence helped, or just the last three commands, but clearly it started working. I also found there's a Developer Option to Enable Debugging on Wifi, and you select your hotspot. That may also prevent it working, so check that as well.

Good luck!

3

If you've previously authorized the RSA fingerprint of your PC and tried adb kill-server etc. with no luck, your problem might just be that you're trying to connect to it while it's locked. Try pressing the screen-on button and entering your pattern - this fixed it for me.

3

The best way I figured is by disabling and then enabling the device from Device Manager and running the adb devices command.

  1. Go to the start tab and right click on Computer
  2. From the drop down menu, click Manage
  3. From the computer management screen, click Device Manager
  4. On the right pane, expand portable devices to find your device
  5. Right click on your device name and click disable on the drop down menu
  6. When it gets disabled, repeat step 5 except for enabling it.

The device will be back online. It's faster.

3

As nobody gave an answer for my situation: you may not have access to the ~/.android/adbkey file. If you initially start adb with sudo, it will generate a public key pair, writing this to ~/.android/adbkey.pub and ~/android/adbkey. Of course, the private key is chmod 600 - only readable for root in your home directory. Subsequently starting adb as normal user will give no access to the private key file, which in turn will fail silently with "device offline".

3

What solved for me on Mac was updating adb to the latest version (1.0.32). Now i can see my device online again

3

The reason for a device to be reported as offline is that adb can not connect to it. Adb executable from the development environment creates a connection (socket) with the device under control. The device has a service (daemon) that listens for this communication. The daemon is called adbd (as in adbdaemon). When one enables adb on a device in fact one starts this daemon, so comms can be established with the device.

When the device is reported by adb as offline is because the daemon is not running anymore or is in a state that will not accept connections. Most often than not this happens if the network goes down on an active (network) connection.

The only way that I could fix this was by rebooting the device. One can arrive to fixing the offline status by many other means but restarting the device always works.

3

When I am facing the same issues than doing like below:

  1. Restart adb by issuing adb kill-server followed by adb start-server in a command prompt
  2. Disable and re-enable USB debugging on the phone
  3. Rebooting the phone if it still doesn't work. 99% of my issues have been resolved with these steps.
1
  • 4. Try to plug a cable to another USB slot.That's was helped in my case.
    – dredkin
    Commented May 19, 2020 at 13:19
3

adb reconnect offline - kick connection from device side to force reconnect

3
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
    – k.s.
    Commented Dec 13, 2020 at 7:26
  • how do you know it does not provide answer to this question, it works perfectly for me
    – Asthme
    Commented Dec 14, 2020 at 11:19
  • this answer needs to be at the top IMO
    – ozgeneral
    Commented Apr 5, 2023 at 10:50
3

I tried all of the solutions above. Mostly, adb kill-server would solve the problem. This time, the problem was in USB cable. Poor quality cables in fancy packing don't work.

2
  • This was actually the answer for me as well. I had no idea a cable with insufficient power could inform ADB a device was there and offline but not allow you to issue ADB commands to it. The device I am using might be an outlier though (a large POS device) Commented Apr 26, 2021 at 21:56
  • adb kill-server solved my problems, thanks!
    – mochadwi
    Commented Jan 17, 2022 at 11:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.