Android ADB device offline, can't issue commands
Asked Answered
D

69

392

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.

Domela answered 21/2, 2013 at 3:1 Comment(13)
try another usb port.Wabash
only other port is usb3Domela
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.Wabash
#8163081Cribble
rebooting my device also worked (4.0.4)Brisk
It happened same to me. For my case, I just disable the Developer option and then re-enable. That is it.Avelar
Tried everything listed here, no luck - in fact worse, as it lists the device multiple times in 'offline' status. Occasionally it'll show up ok when running 'adb devices' but it quickly breaks again.Scyros
Actually the one thing I hadn't done is reboot my PC - worked fine after that.Scyros
i turned off debug on the tablet, then back on, then rebbot pc and looks ok nowYesman
Ones can also try disabling then re-enabling the debugging option in the device's preferencesClaude
Sometimes you have to authorize PC access your smartphone. Easily, unlock your android and true the check buttonHindustani
In my case the phone wasn't authorized as debugging, and the screen was broken and black, so I borrow a screen from my friend and after authorizing give back the screen because the phone wasn't offline after the authorization, so with a simple adb shell input text XXXX && adb shell input keyevent 66 I open the phone an access all the contents.Tricyclic
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.Misconceive
L
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.

Lassitude answered 21/2, 2013 at 3:1 Comment(15)
I have r17 but I get the same problem. Will reverting to r16.0.1 help?Amine
@spartacus I don't think so I would think that the problem for you may lie now elsewhere.Remediosremedy
Solved, problem caused by missing platform of Android SDKPaleozoic
Worked exactly in the order described. Final step is to allow it on the phone.Batfowl
Just reboot the phone or device and enjoy, no need to re-start adb nothing else.Shanon
once SDK Manager updates itself it brings another bug.Lickspittle
My android path system environment variable was pointing to an old version of adb. After updating the path, device = not offlineIto
platform tools r16 show my device online, thanks alotIdellaidelle
Had the same problem. Updated adb from 1.0.29 to 1.0.31, re-authorized the PC and it worked.Disentail
just turned off and on USB debugging- no need to restartPiggyback
Same problem here. I had to allow debugging for the host device (pop-up on Nexus 5 phone)Doily
For me, it was the problem with the usb extension cable that was used to connect to the computer. I connected directly to the same usb port and adb is working good again.Skylar
[Windows] in my case, the cause was the version of adb. I was using 1.0.1X showing device offline, and I updated adb version to 1.0.36 then started to work fine.Kiaochow
I literally just waited and then it changed to authorizing then finally to device.Klein
Emulator: close emulator, adb kill-server, wipe data in AVD manager, cold boot emulator in AVD manager, adb reconnectBra
H
203

Just kill the server adb kill-server

Hansen answered 21/2, 2013 at 3:1 Comment(7)
Works if your drivers are already upto date and still getting a problem. In other cases too, it may work I think.Datcha
Be sure to disconnect any other machines from the device. In my case, my virtual machine host was still connected via tcpip and my guest could still connect successfully, but it would be offline. To get the RSA prompt, I had to run the adb kill-server command on my host before connecting on my guest via adb connect 192.x.x.x.Herminiahermione
adb start-server after thatLitotes
In general that's the trick. Accept answer is for special case.Swordcraft
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.Soil
adb kill-server did remove all my additional offline devices and problem solvedRosen
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.Abram
L
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.

Lassitude answered 21/2, 2013 at 3:1 Comment(15)
I have r17 but I get the same problem. Will reverting to r16.0.1 help?Amine
@spartacus I don't think so I would think that the problem for you may lie now elsewhere.Remediosremedy
Solved, problem caused by missing platform of Android SDKPaleozoic
Worked exactly in the order described. Final step is to allow it on the phone.Batfowl
Just reboot the phone or device and enjoy, no need to re-start adb nothing else.Shanon
once SDK Manager updates itself it brings another bug.Lickspittle
My android path system environment variable was pointing to an old version of adb. After updating the path, device = not offlineIto
platform tools r16 show my device online, thanks alotIdellaidelle
Had the same problem. Updated adb from 1.0.29 to 1.0.31, re-authorized the PC and it worked.Disentail
just turned off and on USB debugging- no need to restartPiggyback
Same problem here. I had to allow debugging for the host device (pop-up on Nexus 5 phone)Doily
For me, it was the problem with the usb extension cable that was used to connect to the computer. I connected directly to the same usb port and adb is working good again.Skylar
[Windows] in my case, the cause was the version of adb. I was using 1.0.1X showing device offline, and I updated adb version to 1.0.36 then started to work fine.Kiaochow
I literally just waited and then it changed to authorizing then finally to device.Klein
Emulator: close emulator, adb kill-server, wipe data in AVD manager, cold boot emulator in AVD manager, adb reconnectBra
D
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.
Distinctive answered 21/2, 2013 at 3:1 Comment(4)
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!Humdrum
This works for me (Galaxy Tab GT P7500 with windows 7)Wellesley
Worked for me with Android 8.0 and Windows 10Waylay
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.Miss
T
65

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

Tecumseh answered 21/2, 2013 at 3:1 Comment(7)
Worked for me too. Nexus 10 sometimes seem to draw too much current for the USB portArctic
Wow, after 1/2 hour of dead ends, this it turns out that this is USB powering issue! Thanks!Veritable
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...Barbiturism
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.Lobo
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.Fairweather
While I can't give more upvotes, this answer is the most straight forward and has perhaps the most merit given the simplicity of the solution. Worked for me. Would be great to know from Google what factors might affect one port working vs another (all of mine are 2.0).Telemeter
4 hours wasted for me. After weeks of dodgy connections (device kept disconnecting when trying to deploy an app from visual studio) this solved it all!Xylene
S
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
Sniffy answered 21/2, 2013 at 3:1 Comment(6)
"'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?Lazuli
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.Sniffy
the command given can be used on windows as long as it is done from your path\to\android-sdk\tools\ directoryLetourneau
In Windows 7, to issue the command from the ...\android-sdk\tools\ directory and have it work, run the command window "As Administrator".Dubois
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!Refutative
this worked for some reason. I didn't even allow it to complete - I killed the process as the download was starting. The security prompt on the device to allow debugging was displayed almost immediately after issuing the command.Cleodel
R
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 ;)

Rumple answered 21/2, 2013 at 3:1 Comment(1)
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.Pumping
D
27

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

Dovekie answered 21/2, 2013 at 3:1 Comment(3)
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.Martinmartina
This was the only method that worked for me, combined with revoking USB debugging authorizations.Decoct
My device offline problem appeared after I performed kill of adb processes. This is also for me the only method that helped.Para
L
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.

Legitimate answered 21/2, 2013 at 3:1 Comment(8)
This is what happened with me. I think something I downloaded to install a ROM two years ago was the culprit.Brittanybritte
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".Scissure
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.Dripping
How did it get there though :/ I want to knowSlushy
@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. : )Annabelannabela
Oh also, note that you can easily find where adb is by running "where adb" in the command prompt. The first folder listed is where it's running it from. (you could also use task manager and "go to process", I think)Annabelannabela
@Annabelannabela Hey, I have KingRoot too! I guess that's the problem.Slushy
I also had this but deleting this didn't solve it for me, still have the device showing as offlineOdy
W
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.

Windflower answered 21/2, 2013 at 3:1 Comment(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).Pico
After many hours of trying to find the reason why adb does not work anymore, it was in fact the cable!Optometry
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.Windflower
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.Asher
I had to use a shorter cable - the one I use to charge my phone was too long!Wolbrom
S
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.

Si answered 21/2, 2013 at 3:1 Comment(3)
This did it for me. Thanks. Was bashing my head against a wall since updating my Nexus 7.Diegodiehard
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.Dubois
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!Compound
M
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.

Mochun answered 21/2, 2013 at 3:1 Comment(1)
where is this usr/bin?Ody
R
11

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.

Rosalinarosalind answered 21/2, 2013 at 3:1 Comment(1)
@e-info128 you just have to download and use the latest version of adb available at developer.android.com/studio/releases/platform-tools, this is the correct way to do it if using Windows 10+ Latest Chrome + Android 11 Device.Shadbush
M
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

Minnick answered 21/2, 2013 at 3:1 Comment(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 portViolate
P
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"
Profane answered 21/2, 2013 at 3:1 Comment(0)
T
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.

Trussell answered 21/2, 2013 at 3:1 Comment(1)
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.Radio
T
6

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

Tendency answered 21/2, 2013 at 3:1 Comment(1)
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.Disenthral
M
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.

Midmost answered 21/2, 2013 at 3:1 Comment(0)
K
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

Kalliekallista answered 21/2, 2013 at 3:1 Comment(0)
L
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.

Lassitude answered 21/2, 2013 at 3:1 Comment(1)
This was what was causing the problem for me on OS X, thanks!Clercq
R
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.

Report answered 21/2, 2013 at 3:1 Comment(0)
M
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!

Mustache answered 21/2, 2013 at 3:1 Comment(0)
M
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.
Microcyte answered 21/2, 2013 at 3:1 Comment(0)
M
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.

Mclyman answered 21/2, 2013 at 3:1 Comment(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)Vish
adb kill-server solved my problems, thanks!Platitude
P
3

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

Procarp answered 21/2, 2013 at 3:1 Comment(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 ReviewBridget
how do you know it does not provide answer to this question, it works perfectly for meProcarp
this answer needs to be at the top IMOAlver
D
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.
Drear answered 21/2, 2013 at 3:1 Comment(1)
4. Try to plug a cable to another USB slot.That's was helped in my case.Clambake
S
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.

Shinshina answered 21/2, 2013 at 3:1 Comment(0)
E
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

Enesco answered 21/2, 2013 at 3:1 Comment(0)
C
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".

Coif answered 21/2, 2013 at 3:1 Comment(0)
S
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.

Saskatchewan answered 21/2, 2013 at 3:1 Comment(0)
T
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.

Timid answered 21/2, 2013 at 3:1 Comment(0)
M
2

What mostly works for me is this:

  1. Removing USB and plugging it again.

  2. Using adb devices after adb kill-server

  3. Sometimes, switching to a different USB port on your computer will solve the problem.

Mclyman answered 21/2, 2013 at 3:1 Comment(0)
E
2

Worked for me: in the begining it worked and after a while went to offline. I did the follwong: adb kill-server adb start-server. Plug the phone again with usb to PC adb devices, output of empty list provided. adb tcpip 5555, adb connect <mobile wifi ip address> Then it became online again.

Elyot answered 21/2, 2013 at 3:1 Comment(0)
S
2

I'm surprised to find my solution wasn't listed here.

For me, I have an LG G3. The phone must be connected using LG's driver. I went to

Device Manager > uninstall MTP Driver

and immediately adb worked without 1 sec literally.

Slushy answered 21/2, 2013 at 3:1 Comment(0)
K
2

Try

adb usb 

i changed my connection method to tcpip and then i thought if i kill the server and start it, it will reset the connection method but it will not

this is why none of the previous answers worked in my case

Karmen answered 21/2, 2013 at 3:1 Comment(0)
A
2

late but I found the easiest way just go to DDMS and follow as shown in image...

enter image description here

Ambriz answered 21/2, 2013 at 3:1 Comment(0)
D
2

Restart the device. I tried everything listed here to get my HTC phone (running Android 4.0.3) working, but adb devices kept saying it was offline. After I restarted the phone, it was finally online. Some of the other suggestions here may have contributed to the phone being recognized, but doing a few restarts along the way as you're trying them out certainly won't hurt.

Dubois answered 21/2, 2013 at 3:1 Comment(0)
C
2

Try to restart the adb server as follows:

adb kill-server

adb start-server

I have also came across the same problems as yours. And restarting the adb server will resolve this problem.

Courtship answered 21/2, 2013 at 3:1 Comment(0)
S
2

It's just because your computer doesn't have the right driver. To fix that:

  1. Download and extract Android SDK

  2. Go to Device Manager (Right Click on Computer --> Properties --> Device Manager

  3. On the right pane expand portable devices to find your device

  4. Right click on your device name and click Update Driver Software

  5. Browse my computer for driver software

  6. Browse to your Android SDK folder on step 1.

  7. Next and you're done

Spirillum answered 21/2, 2013 at 3:1 Comment(2)
Same for me on Windows 7 and with Nexus 7. It stopped working, I removed the driver, installed it again and it workedFendley
In my case, it is my USB 3.0 controller driver which doesn't work! Not driver for the phone!Raw
B
2

I updated many times, until I couldn't update any more, but I never got a prompt on my screen; I just kept getting the device offline.

My problem was that I was running the ADB command from a different directory to what was actually being updated.

The correct updated directory for the ADB exe is:

C:\Program Files (x86)\Android\android-sdk\platform-tools\
Backpedal answered 21/2, 2013 at 3:1 Comment(0)
M
1

If you are getting this while connecting your device wirelessly through tcpip then try disconnecting your device:

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.

Mortimer answered 21/2, 2013 at 3:1 Comment(0)
G
1

Here are the steps you can do it through command line.No need to access devices.

Step 1: do "adb devices -l" and you will see the offline device. Now note down the number after usb: Example=> usb:1-1.4.2

Step 2: echo '1-1.4.2' |sudo tee /sys/bus/usb/drivers/usb/unbind

Step 3: echo '1-1.4.2' |sudo tee /sys/bus/usb/drivers/usb/bind

Step 4: Check "adb devices -l". That devices should be online.

Guardhouse answered 21/2, 2013 at 3:1 Comment(0)
A
1

None of these answers worked for me. The device was always offline. What really solved it was just patience!

Namely, just waiting one minute before issuing adb devices after the adb connect command automatically fixed the issue 100% of the times.

Anachronism answered 21/2, 2013 at 3:1 Comment(0)
B
1

This is a lame case, but just in case... I have a mac laptop with a power/usb hub but it only has a couple usb ports so I hung another powered usb hub off that. Seems/seemed to work fairly well, but for some reason my android device wouldn't keep a connection. Plug it in, it shows 'device', but try to do anything via adb and get an error and status goes "offline". Drove me crazy. Then I decided to try plugging in Android device straight to the first hub... worked immediately and solidly. I had been using the two hub setup for a while, but all of a suddden it just stopped working. Hope it helps somebody!

Beatnik answered 21/2, 2013 at 3:1 Comment(0)
R
1

Most likely this is due to an out dated adb process. This may happen due to crappy developers who package adb, the dlls and install them in the root directory of Windows. Such as C:\Windows\adb.exe

Open task manager kill adb.exe, located the adb.exe most likely in root:\Windows and remove it. Then use an up to date SDK

Reinhold answered 21/2, 2013 at 3:1 Comment(0)
L
1

In Linux: remove the directory ~/.android and restart ADB.

Lassitude answered 21/2, 2013 at 3:1 Comment(0)
B
1

For me, it turned out that I had two different SDK installations. When I launched the Android SDK Manager and updated the tools from Eclipse, the SDK path pointed to one location, but the PATH environment variable used on the command line pointed to another location, that had an older version of the SDK, which always shows the 4.2.2 device as offline.

Bostick answered 21/2, 2013 at 3:1 Comment(1)
Thats actually what happened to me too, My java editor (Eclipse) Was pointing to a different sdk installation.Domela
S
1

I encountered this problem as well. I updated everything I could in the Android SDK Manager, uninstalled my device using Device Manager, and now it works correctly. I issues a few "kill-server" and "start-server" along the way...

Secession answered 21/2, 2013 at 3:1 Comment(0)
D
1

After trying everything two times, I rolled back the phone software to a stable build, and it finally worked. I was running Cyanogen nightlies. Regardless, the things posted in this thread should help anyone who encounters this problem.

Domela answered 21/2, 2013 at 3:1 Comment(0)
S
0

Steps that worked for me:

  • Pressing "Revoke USB debugging authorizations" in developer options
  • Running adb kill-server on my computer
  • Enabling and disabling "USB debugging" in dev options
Stratocumulus answered 21/2, 2013 at 3:1 Comment(0)
M
0

Use WiFi and an USB charger

None of the other solutions worked for me.

The trick was:

  • Plug the cable, which is connected to the device, in a charger
  • Charge the device to 30% (YMMV)
  • Plug it in the computer
    • Even when the device has USB-C, you must use an USB2 port on the computer
    • If your computer only has USB3, see below
  • adb tcpip 5555
  • Plug it back into the charger
  • adb connect $IP 5555
    • You can find $IP usually in the WiFi settings of the device

Apparently adb on my device automatically powers down if the battery level drops to 25%. (At my side it then stayed there. Apparently the power conserving functionality worked as intended.)

With everything else (reboot, unplug and replug, change developer mode, change cable, change computer) I can see it in adb, but it goes offline as soon as I try to connect to the adb daemon on the device (perhaps because the adb daemon in the device is stopped when battery gets too low).

As my device refuses to operate with USB3 (keyboard, mouse and other USB3 equipment works perfectly on those ports, and the same cable even offers 5 Gbit/s), I can only use USB2 ports. USB2 only offers 500mA (2.5W) max while the device needs more when it is not sleeping (3W when if display on, up to 18W while charging).

Usually one has activated the option "stay alive when debugging", so with an adb connection the device never sleeps and tries to draw more than the allowed 500mA - which also can result in USB instabilities.

So even if the device shows "charging", the battery may drain slowly

If you happen to have some powered USB2 hub which is completely outside of the USB spec (read: buy cheap) it might work that the device gets enough power out of an USB2 port (a cheap 4 port hub may wrongly and dangerously offer the full 2A on a single port. This is dangerous, as spec conforming cables may start to burn if they are exposed 4 times the allowed current. This then is not the cable's fault!). However do not count on that, so do not buy something with some expectation. Instead try everything you already have (look if the battery drains).

See next.

USB3 to USB2

My device has USB-C. My computer has USB-C 3.2 Gen 2, USB3 and USB2.

  • Plugging in the device into USB2 with a cheap USB3 to USB-C cable works
  • Plugging in the device into USB3 with a cheap USB3 to USB-C cable does not work
  • Plugging in the device into USB3 with an expensive power measuring USB-C to USB-C PD charge and data cable works
    • This works, because the expensive cable only offers USB2 data transport
    • You can read this in the spec of the cable (if you find it. It likely can be found in the sub-notes of the sub-notes of the notes in a well hidden page of the manufacturer, which you can only find after contacting the manufacturer and waiting 6 months for some reply. YKWIM).
    • "Full speed" is 12 Mbit/s AKA USB1 speed
    • "Hispeed" is 480 Mbit/s data transfer AKA USB2 speed. This is what we need for adb.
    • "SuperSpeed" is 5 Gbit/s (and above). However there are so many different and incomatible modes in that category, that "SuperSpeed" is unequal to "SuperSpeed" usually.
  • For SuperSpeed to work, all 3 components must support the same mode:
    • Device (which most often only supports 1 mode)
    • Cable (it has a chip in it for this which often only support another single mode)
    • Host (AKA Computer, which most time offers many but not all modes)
  • Note that USB2 cables do not need an active chip. They only had some special wiring with some passive pullup resistor, which many cheap cables out there of the first generation got wrong. But this got much better in the last years, so even the cheapest USB2 cable should work.

The good thing with the chip is, that conforming cables can no more create some danger if some other component cheats, like the USB hub. If you are in USB3 mode and try to transfer more power over such a cable than the cable allows, the power transfer will simply fail, because the non-cheating parts will not do it. So no more burning cables due to use outside of the spec. This is needed, as USB offers PD up to 240W (and in future likely more). So without such safety, cables would go up in flames all too often.

Note that 10W from usual USB2 chargers already is dangerous enough. My soldering iron for SMD has 5W, and soldering irons can reach temperatures where paper and wood already start to burn on themself. So a wrong cable used with some USB2 charger can reach that temperature, too (which is unlikely only because the insulation of the cables starts to melt before so they get a shortcut, which most chargers can detect and shut off the power).

So if you have trouble to connect to the device in USB mode for adb:

  • Be sure the device is charged
  • Be sure to use USB2 for data transfer
    • Perhaps newer devices offer real USB-C, but none of mine do this
  • You can try to use an USB2 hub plugged into your computer's USB3 port
  • Or you can use some USB2-only cable
    • Which is difficult today if it needs to have USB-C
    • There are many USB-C charge only cables out there which offer no data transfer
    • Most cheap USB-C data cables allow some USB-C speed which makes adb fail
    • Perhaps use some Micro-USB to USB-C adaptor with some Micro-USB cable
    • Many expensive USB-C PD charging cables with data transfer offer 480 Mbit/s only, which is USB2 and which is what we need here!
    • I have quite some PD charging cables with USB-C to USB-C which only offer 480 Mbit/s!
  • FYI
    • 12 Mbit/s is USB1
    • 480 Mbit/s is USB2
    • 5000 Mbit/s is USB3
    • 10000 Mbit/s is USB3.1
    • 20000 Mbit/s is USB3.2

Please bear with me if I am not 100% accurate here. There probably is not much on earth which is more complicated than the USB spec. Even the bible looks much more readable and more precise to me.

Warning!

  • Many expensive USB-C to USB-C cables sold as being compatible with USB3.2 Gen 2 with 20 Gbit/s and/or Thunderbolt effectively only offer 480 Mbit/s data transfer!
  • This is due to the shitty USB spec, which does not mandate that a conforming cable must fully conform to all modes
    • Physically these cables may offer 20 Gbit/s
    • But they often only implement a single mode
    • There are (at least) 4 USB modes to chose from, plus one Thunderbolt mode
    • These cables often only support 1 USB mode (and perhaps Thunderbolt)
    • The mode supported usually is unsuitable for real data transfer to things like external drives. But if you are lucky it happens to work with your display
    • Hence all these expensive cables most times fall back to USB2 speed. You only note this, if you measure your speed. (Often 480 Mbit/s is more than the an Android Device is able to handle anyway. So most users do not see the difference.)
    • Which means, these expensive cables are very likely to work with adb on your Android USB-C device.

In contrast, cheap USB3/USB-C to USB-C cables (those which are not charge-only) often support most USB3.0 modes and hence allow data transfer up to 5 Gbit/s. They do not offer video and Thunderbolt modes (these came with USB-C 3.1), though, so they do not work with your display.

These cheap cables then fail to connect to adb on the device, as all components detect, that the device is USB3 capable, so they do not fall back to USB2 which is needed to connect to adb.

So it is the other way round. Cheap cables do it right, and hence fail with adb on an USB3 port. OTOH the expensive cables cheat on you and are not even slightest worth the price! However, due to the cheating, they accidentally work with adb.

Some measurements with my device (all with the same USB-C to USB-C cable using some 1€ passive USB-C to USB3 adapter if needed):

  • 4.8V, 0.5A, 2.4W on USB2 on the Computer
  • 4.9V, 0.5A, 2.4W on USB3 on the Computer
  • 5.0V, 0.5A, 2.5W on USBC 3.2 Gen 2 on the Computer
  • 4.9V, 1.8A, 8.8W on my old USB2 charger
  • 5.8V, 3.0A, 17.7W on some unbranded cheap 20W USB-C PD charger

With the latter the USB charger gets hand-warm (40°C) but the device starts to boil (60°C).

My device is old. It was bought a long time before cheap PD chargers were available. So I think the manufacturer never tested a full charging cycle with more than 10W. Or they used some cryogenic environment, as in normal circumstances, a full charging cycle with 18W will likely melt or explode my device.

A final note:

Some mainboards offer USB-C PD with data transfer already. These boards can power your screen and even other computers with a single cable while transferring video and other USB connections (Mouse etc.) over this single cable, too. On such devices you may succeed to:

  • Power your Android device enough so it stays charged
  • and get (only) 480 Mbit/s data transfer at the same time

with some expensive PD charging and data cable (which only offers USB2 speed for data transfer), such that adb works.

This is a theory. As I do not own such a mainboard yet, I cannot check this.

Morrow answered 21/2, 2013 at 3:1 Comment(0)
M
0

Just kill the adb by type command -> adb usb

Mccall answered 21/2, 2013 at 3:1 Comment(0)
A
0

first time, you should usb cable to connect

Adobe answered 21/2, 2013 at 3:1 Comment(0)
G
0

I tried absolutely everything you could think. 6hrs on this.... For a dumb solution.

What appears to have worked for me was shut down laptop, unplug laptop, pop the battery, holding the power button for 10s, starting it again.

So mad. But maybe it will help someone else.

NOTE: My situation was: everything was working hunky dory, literally had devtools windows open and working, and, poof all 3 devices went offline. (and never came back no matter the number restarts [computer + devices], install/uninstalls of drivers/adb/android studio, windows updates, toggling of debugging options.)

My theory is some kind of charge/power thing happened.....

Gish answered 21/2, 2013 at 3:1 Comment(0)
S
0

OK, here's no voodoo, no blind-trying and (I hope) well explained solution to this (sorry for the rage, I tried googling for solution almost for a whole day to no avail).

First, let's read about ways adb communicates with the device: https://android.googlesource.com/platform/system/core/+/master/adb/protocol.txt

Short story: host adb establishes server on 5037, connects to adbd on the device via tcp port 5555 (default).

That means - to work, your adb's got to have a clear road to your local 5037 and remote 5555. You can setup adbd on the device (using device terminal) to listen without establishing USB connection first, if you cannot or do not want to use USB:

setprop service.adb.tcp.port 5555
stop adbd
start adbd

Check with netstat -plant | grep adbd if adbd is listening on port 5555 (or any other you've chosen).

Now fire up Wireshark with capture filter port 5555. Execute this command on your host: adb connect device_ip:5555 (replace 5555 if you're using non-standard port).

According to the document above, you should see CNXN commands from both directions! If your remote end doesn't reply, adb devices will say your device is offline! And it's a game over. adb devices doesn't do any network exchange, it just shows you the result of the adb connect command.

My problem was - I've been running Android inside a Virtualbox with NAT networking and forwarded 5555 port. Also, I had an emulator running on port 5554. It didn't occupy 5555, but somehow, these two interfered and disrupted Virtualbox's connection at the lower level, as I had lots of weird duplicate ACKs and RSTs flying all over the interface. A solution for this problem was to pick a different port.

Please tell me if I'm wrong, but I didn't see anyone proposing this before. Neither explaining how and why it should work.

Sard answered 21/2, 2013 at 3:1 Comment(0)
S
0

Disable your antivirus, reconnect usb and check if adb.exe was not moved to quarentine.

Saharanpur answered 21/2, 2013 at 3:1 Comment(0)
C
0

In my case, I was running into this problem with a 1st gen Asus Nexus 7. I had increased the logging buffer size from 256K to 4M. As soon as I restored it to the default value (Settings>Developer Settings>Logger buffer sizes), unplugged and plugged the tablet back in, it worked perfectly.

Chole answered 21/2, 2013 at 3:1 Comment(0)
S
0

Tried everything above for several hours. Thing that made it work was running android studio with no app started. You can still use chrome for remote debugging of the device.

Scatter answered 21/2, 2013 at 3:1 Comment(0)
D
0

None of these answers worked for me, tried Wireless too. I noticed adb.exe was constantly running in my system processes. Right clicked on them and found adb was running automatically from an installed app (Droid Explorer in my case). Once I uninstalled the app that was automatically starting ADB, i could kill the process and see that adb was no longer running on it's own. Ran the updated adb from platform-tools and good to go! Hope this helps someone.

Danialdaniala answered 21/2, 2013 at 3:1 Comment(0)
I
0

Just share my condition:

In my LAN, all andorid boards have same MAC address default. So it will get same IP through DHCP as it have same MAC address.

In LAN, there are multiple android boards with same IP. And adb could connect to the board(one of them), and could open shell of the board(one of them), but get "device offline" when push file to board, or other operation.

Solution: rewrite MAC address, get different IP.

Institution answered 21/2, 2013 at 3:1 Comment(0)
F
0

I needed to kill multiple adb processes (adb kill-server & adb start-server still left a lingering process alive.)

$ ps aux | grep adb

$ killall adb

Fingering answered 21/2, 2013 at 3:1 Comment(0)
W
0

Not really an answer, but more contributing to something which is obviously an issue with CM. I've got an HTC Inspire HD running cm-11-20140309 Unofficial BR1-ace (stable version). I was able to use adb prior to update, but I never installed SDK since I had no need. I've tried all of the above and more.

At first I thought my issue was the MTP driver but it wasn't. After installing and updating SDK to include 4.4.2, the HTC MTP Device driver installed fine when connected via USB but using adb from the new sdk install location still shows the device as offline on both mtp, and ptp modes on the phone with debugging both of and on. When I disable usb debugging the phone automatically reboots, and I receive the error:

"Unfortunately the process android.process.media has stopped"

The new CM has an option under developer options to enable debugging over WIFI, so I tried that as well, and it simply says unable to connect to the IP address and port. Like the other poster, I can ping the IP address.

I also checked the option to enable root access for ADB and apps because it was set to only APPS and still the phone shows offline when I do adb devices and occasionally it throws the same error shown above.

EDIT:

Now, my phone just force rebooted, I renabled debugging, plugged it in and ran adb devices, and I was finally prompted by the phone for the RSA key. For some reason I was not prompted before and now the phone is connecting. So perhaps the issue is needing to switch root access from just apps to apps and adb after a fresh reboot.

Here is why it shows offline: http://playingwithsid.blogspot.com/2013/05/android-device-offline-fixing-adb.html

Woodenware answered 21/2, 2013 at 3:1 Comment(0)
P
0

Just enable/disable ADB integration from Tools -> Android. That worked for me. I am using Android Studio beta.

Puffin answered 21/2, 2013 at 3:1 Comment(0)
L
0

For me, it's that the USB cable was not plugged in all the way into the slot. Although it shows charging on my Nexus 5.

Lassitude answered 21/2, 2013 at 3:1 Comment(0)
L
0

None of the other answers worked for me. I have just upgraded to CyanogenMod 10.1 (Android 4.2.2) on my Galaxy S III. What worked for me was to enable debugging in developer options (to enable, click seven times on the build number in 'about phone') and then plug in via USB. Then I accepted the prompt which came up.

Lassitude answered 21/2, 2013 at 3:1 Comment(1)
Until you did that the device wouldn't even show up as offline, I think you're misunderstanding the issue.Esdras
L
0

I had the same problem, while trying to install CyanogenMod on Galaxy S III from Ubuntu. In the end, I simply copied the ZIP file to the external SD card, by attaching the SD card directly to the PC. Then I moved the card back to the phone, and when I rebooted the phone, I could install CyanogenMod from the SD card.

Lassitude answered 21/2, 2013 at 3:1 Comment(0)
L
0

I just started facing the same issue after the latest CyanogenMod nightly update (12th aug 2013) on my Samsung Galaxy S III.

I used the ADB binaries suggested in the topmost answer (by hack_on edited by w. allison), and I got a prompt on my phone asking to allow access to my PC (its RSA key)!! It's working fine now.

Download link (ADB, Fastboot and related binaries only): https://dl.google.com/android/repository/platform-tools_r16.0.1-windows.zip

Lassitude answered 21/2, 2013 at 3:1 Comment(0)
B
0

I have used ADB version 1.0.29, and it could be connected to my LG-F160K (JB 4.1.2) and Nexus 7 (Android 4.2.2 (Jelly Bean)). LG-F160K worked with ADB 1.0.29, but the device status of Nexus 7 was always "offline".

I have downloaded adt-bundle-linux-x86-20130219.zip from the Google Android website, and I can connect to Nexus 7 now. I'm currently using ADB version 1.0.31.

Just download the latest SDK or update your ADB utility.

Bonnibelle answered 21/2, 2013 at 3:1 Comment(0)
W
-2

Open Developer options from device and disable then enable USB debugging.

Wallack answered 21/2, 2013 at 3:1 Comment(1)
This option is not even present on all Android devices. Chrome OS for example only allows debugging via WiFi connection.Kidd
C
-10

If any of above tips are not working, try these steps to unlock OEM:

  1. Open command prompt and set your platform tools path.

  2. Type in "adb reboot bootloader".

  3. Then type in "fastboot oem unlock".

  4. On a few devices it will take more time. Please be patient till @15 min.

  5. Reboot the device

Cerebrospinal answered 21/2, 2013 at 3:1 Comment(2)
No one should really try this. Depending on where you are, you are most likely going to void your warranty. Unlocking the bootloader is not a solution to every issue.Scuba
If you run fastboot oem unlock you'll WIPE your phone. This is almost certainly not the solution to the problem described.Bellwether

© 2022 - 2024 — McMap. All rights reserved.