58

I use "adb devices" to get following result. Only one device is connected to PC by USB, but we get 8 lines of result.

Could anyone suggest the reason?

WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
WH96TNE00361    offline
Nilesh Thakkar
  • 2,877
  • 1
  • 24
  • 43
susantjs
  • 939
  • 2
  • 10
  • 19
  • please refer following link for the answer. its faster: http://stackoverflow.com/a/17095525/727654 – Nishant Soni Jun 13 '13 at 19:36
  • 1
    Most of these answers are some variant on "upgrade adb" and or / "reinitialize stuff." The one that solved it for me was Krystian's below. ADB was switched to wifi mode so wouldn't work over USB. I bet a lot of people have that problem. – foobarbecue Aug 26 '13 at 23:39

20 Answers20

80

Try the following:

  1. Unplug the usb and plug it back again.

  2. Go to the Settings -> Applications -> Development of your device and uncheck the USB debugging mode and then check it back again.

  3. Restart the adb on your PC. adb kill-server and then adb start-server

  4. Restart your device and try again.

Andreas Lymbouras
  • 1,025
  • 17
  • 26
  • 5
    5. Upgrade to the newest SDK / adb, if your device is >=4.2.2 – misterbee Aug 15 '13 at 21:10
  • 4
    I fixed the issue (on my Nexus 5) by going to the notification area, tapping on the USB connected and unchecking "Use as Media" or something. Now it shows correctly in adb. – Scott Fister Jan 30 '14 at 05:48
  • 2
    in my case it was simply because my device was displaying a dialog "allow RSA" and I didn't notice :0. Just allowed "always" and the device now appears as "device" instead of "offline" – ihadanny Feb 07 '14 at 21:12
  • 2
    Here's what worked for me, after upgrading, trying everything, etc. It was what scottastic suggested, I switched my phone from MTP to a PTP (camera) device, and this brought the RSA prmopt up. Now it's connected as adb. I was even able to switch it back to MTP afterwards. – Dannid Mar 10 '14 at 00:25
  • 1
    doesn't work for me either. the strange thing is android studio has no problem detecting the device but I cannot from the command line – user210757 Oct 21 '14 at 13:49
  • I didn't even know what adb was but mine was turned off for some reason O_O. All I had to do was step 2 and 3. Thanks so much!! – Pineapple Nov 21 '19 at 10:17
  • Unfortunately these 4 steps didn't work for me. I can't figure out how to get my device to pair to ADB again. – Ryan Jan 03 '21 at 22:20
35

To complete the previous answers, another possible solution is to change the USB socket in which your cable is plugged in.

I had this problem (with the classical answer about using adb kill-server / start-server not working) and it solved it.

Actually, it took some time to find that because Windows was correctly recognizing the device in my first socket. But not ADB. As Windows was recognizing the device, I had no real need to test other USB physical sockets. I should have.

So you can try to plug the cable in all your USB physical sockets directly available on your computer. It did worked for me. Sometimes the USB sockets are not managed the same way by a computer.

Vincent Hiribarren
  • 5,254
  • 2
  • 41
  • 65
  • This worked for me! Thanks! Because I was thinking of throwing the damn thing out the window. I had to plug it to a red/pink coloured USB slot (3.0) – aliopi Jun 23 '12 at 11:48
  • Switching USB ports fixed this for me when nothing else did. Thanks! – DataGraham Jan 10 '13 at 16:04
  • Windows 8 here and for whatever reason this also fixed my problem! – Deadron May 09 '13 at 03:31
  • This was for me. I was using a front panel usb on my case. On the second front panel port, I had connected a steering wheel, and because of this it was not working. When I've disconnected the wheel it was working ok. Oh and it was also working with the other 50 usb ports I had available, including even the keyboard ones. That scumbag one I was using, didnt. – Mihai Morcov Feb 27 '16 at 09:23
22

Beginning from Android 4.2.2, you must confirm on your device that it is being attached to a trusted computer. It will work with adb version 1.0.31 and above.

psihodelia
  • 29,566
  • 35
  • 108
  • 157
  • 2
    This is very likely the problem I'm having as it only started when I upgraded to 4.2.2, however, no matter what I do I can't get any popup to appear that asks me to authenticate. – crdx Feb 23 '13 at 13:55
  • I upgraded to the latest SDK (I had 1.0.29 or something, and now I have 1.0.31 (is that what you meant by 1.0.3?) and it now pops up. – crdx Feb 23 '13 at 15:51
  • 1
    @crdx Be sure you have "Settings->Developer Options->USB" debugging enabled. Then attach your device to a host, then your device should show a pop-up; you only need to confirm you trust this host. – psihodelia Feb 25 '13 at 09:56
  • @Pointy please see my answer to crdx above – psihodelia Feb 25 '13 at 09:56
  • @psihodelia as far as I can tell the Nexus 7 tablet doesn't do that. – Pointy Feb 25 '13 at 14:38
  • @Pointy are you sure that you have Android 4.2.2 ? – psihodelia Feb 25 '13 at 15:46
  • @psihodelia Android 4.2.2, Build JDQ39 - I'm in dev mode, and the tablet says so, but plugging it in to my workstation results in no popup or anything. – Pointy Feb 25 '13 at 15:54
  • 2
    ... but `adb version` is only reporting 1.0.29; that's odd because I just installed it a few days ago ... – Pointy Feb 25 '13 at 15:55
13
 adb kill-server
 adb start-server

that solved my problem

mudcup
  • 151
  • 2
  • 7
11

I've had a similar issue with one of my phones. I was unable to connect and use usb debugging on any of my computers. In the end, I had to restart the usb debugging on the phone manually [doing so using the Developer menu was not enough].

There's only one command you have to run on your phone [I did it using Terminal Emulator app]:

adb usb

And that was it.

Hope this helps someone in the future.

Krystian
  • 3,193
  • 2
  • 33
  • 71
  • 1
    This was my issue. I had switched to using ADB over wifi by typing "adb tcpip 5555" and then tried to use ADB when the wifi was down. You can end up in quite a bind if you don't have a terminal installed on your device! Crazy that there isn't one included by default. – foobarbecue Aug 26 '13 at 23:37
  • hmmm I just installed Terminal Emulator and tried using that command, but it said the command wasn't found. how did you manage to get adb commands on the device itself? – YasharBahman Feb 12 '15 at 05:23
  • @YasharBahman hm, just typed the command, I had to do nothing. Tested on Galaxy S2 and S5. – Krystian Apr 07 '15 at 08:06
10

You may also try downloading newest version of adb http://developer.android.com/tools/help/adb.html

rkj
  • 8,787
  • 2
  • 29
  • 35
  • 5
    This is the solution if you just upgraded to Android 4.2.2; they added a thing where you need to whitelist a computer before it can debug the phone, and the old SDK doesn't support it – Michael Mrozek Feb 21 '13 at 08:03
  • That's what it was for me...the adb in my path was from 4.2.1, instead of the one in my build system, 4.2.2. – mateor Feb 22 '13 at 16:40
5

Reboot the device. This always fixes it on Mac OS, whereas adb kill-server does not.

izak
  • 822
  • 3
  • 11
  • 18
5

On my Galaxy Nexus with Android 4.2.2, I had the same problem initially, 'adb devices' was showing the device but with offline status (USB debugging was initially active on my device).

These are the steps I took to remedy the situation :

  1. Disable USB debugging (Device not connected to PC)
  2. Re enable USB debugging
  3. Now connect to your PC, now a pop up on the device (not on PC) will ask you for authenticating the PC, Thats it...

adb devices now lists both device id and no offline.

blo0p3r
  • 6,790
  • 8
  • 49
  • 68
Raj
  • 51
  • 1
  • 1
  • This is very likely the problem I'm having as it only started when I upgraded to 4.2.2, however, no matter what I do I can't get any popup to appear that asks me to authenticate. – crdx Feb 23 '13 at 13:54
  • I upgraded to the latest SDK and it now pops up. – crdx Feb 23 '13 at 15:51
3

I post here my question just in case is helpful for somebody else. My problem was that my colleague was connected to the same device and I was not able to connect to the same device.

Note: I had this problem with Amazon Fire TV connecting over Wifi.

There are 2 solutions:

Easy to "drop" his connection (sorry buddy :)

Restart the device
adb kill-server
adb start-server
adb connect device-ip

A bit more difficult but two clients can use the same device (use different TCP ports)

Please look at this answer

Community
  • 1
  • 1
TomCobo
  • 2,886
  • 3
  • 25
  • 43
2

For me with Android 4.1.1 only rebooting device works

1

Run SDk Manager and install Android SDK Tools and Android SDK Platform-tools updates. ADB must be updated to a new version for 4.2.x

JUZZIE87
  • 11
  • 3
  • That's it. Also, please remember that sometimes you [or something else] may install adb in a different location and create a symlink in `/usr/bin` . Make sure you run the correct, updated, one – Krystian Feb 19 '15 at 07:58
1

I had the same issue and none of the other answers worked. It seems to occur frequently when you connect to the device using the wifi mode (running command 'adb tcpip 5555'). I found this solution, its sort of a workaround but it does work.

  1. Disconnect the usb (or turn off devices wifi if your connected over wifi)
  2. Close eclipse/other IDE
  3. Check your running programs for adb.exe (Task manager in Windows). If its running, Terminate it.
  4. Restart your android device
  5. After your device restarts, connect it via USB and run 'adb devices'. This should start the adb daemon. And you should see your device online again.

This process is a little lengthy but its the only one that has worked everytime for me.

Aaron
  • 2,070
  • 1
  • 15
  • 9
1

Had this on client's machine it turned out he had an out of date version of adb installed via website offering adb and fastboot. The client in question didn't want to install the whole SDK because of perceived bloat :S .

So if you're seeing offline make sure you've downloaded and using the latest adb. I ended up emailing him adb executable.

Also worth checking that the adb you are using is the correct one in the Path. i.e on Mac

$ which adb
/Users/me/dev/adt-bundle-mac-x86_64/sdk-macosx/platform-tools/adb 
scottyab
  • 23,621
  • 16
  • 94
  • 105
1

if non of the steps work from the above. my device still offline after connected through wifi. i did the following:

go to your device...

  1. go to settings.

  2. go to developer options.

  3. Allow adb debugging in charge mode only.

  4. repeat the steps as you always do . which is:

    a. connet your usb on chargemode only. b. open command write: - adb tcpip 4455 - adb connect 192.168.1.11:4455 b. disconnect usb.

now everythings work for me .

Malek Tubaisaht
  • 1,170
  • 14
  • 16
0
  1. make sure the device is set for usb debugging
  2. Have the adb client running (e.g. via "adb usb" or adb start-server"
  3. LEAVE the device connected via usb!!!
  4. AND THEN reboot the device.

This always brings my Motorola MB525 "online" again, after adb complains it would be "offline". I'm using OSX btw.

robert
  • 978
  • 7
  • 17
0

I made adb working on Android 4.4.2 with GT-N8010 (Samsung tablet) after setting device in authorized mode once upgraded adb to SDK version.

~/local/opt/Android/Sdk/platform-tools/adb
Android Debug Bridge version 1.0.32

While It did not work using :

adb version   
Android Debug Bridge version 1.0.31

Shiped in Ubuntu LTS version :

apt-cache show android-tools-adb  | grep Version
Version: 4.2.2+git20130218-3ubuntu23

This link may help then

Can't connect Nexus 4 to adb: unauthorized

Community
  • 1
  • 1
RzR
  • 3,068
  • 29
  • 26
0

After wasting hours on it, I have updated my version of adb and now adb devices shows my device online and I can run the app on it again.

Andrea Gherardi
  • 826
  • 1
  • 9
  • 18
0

also make sure adb isn't running in your processes automatically. If it's there right click open file location, figure out what is starting it, kill it with fire. Run the updated adb from an updated android sdk platform tools. This was the issue with mine, hope it helps someone.

JTtheGeek
  • 1,707
  • 14
  • 17
0

What did me in is was that multiple unrelated software packages just happened to install adb.exe -- in particular for me (on Windoze), the phone OEM driver installation package "helpfully" also installed adb.exe into C:\windows, and this directory appears in %PATH% long before the platform-tools directory of my android SDK. Unsurprisingly, the adb.exe included in the phone OEM driver package is MUCH older than the one in the updated android sdk. So adb worked just fine for me until one day something caused me to update the windows drivers for my phone. Once I did that, absolutely NOTHING would make my phone status change from "offline" -- but the problem had nothing to do with the driver. It was simply that the driver package had installed a different adb.exe - and a MUCH older one - into a directory with higher precedence. To fix my installation I simply altered the PATH environment variable to make the sdk's adb.exe have priority. A quick check suggested to me that "lots" of different packages include adb.exe, so be careful not to insert an older one into your toolchain unintentionally.

I must really be getting old: I don't ever remember such a stupid issue taking so endlessly long to uncover.

Scott Petrack
  • 221
  • 2
  • 6
0

Check that the ADB version that you are running is newer than the version of the OS on the connected devices. For me, updating the ADB helped to get the device online.

Diceyus
  • 769
  • 9
  • 13