[android] Android ADB device offline, can't issue commands

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.

This question is related to android adb android-2.2-froyo

The answer is


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.


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.


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


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.


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.


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"

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.


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.


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".


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


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


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.


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.


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.


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.


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


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.


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


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.....


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


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


Try running adb devices after running adb kill-server. Security question pops up after that. Worked for me.


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.


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


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.


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...


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.


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


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.


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


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!


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

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.


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


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


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.

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.


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.


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.

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

enter image description here


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.


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.


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.


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.


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.


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.


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.


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\

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


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.


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


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.


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


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!


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


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 ;)


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.


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.

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


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.


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


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to adb

ADB server version (36) doesn't match this client (39) {Not using Genymotion} ADB device list is empty "unable to locate adb" using Android Studio Run react-native on android emulator Solving "adb server version doesn't match this client" error Adb install failure: INSTALL_CANCELED_BY_USER Session 'app': Error Installing APK Where is adb.exe in windows 10 located? How to debug in Android Studio using adb over WiFi Set adb vendor keys

Examples related to android-2.2-froyo

What does "Failure [INSTALL_FAILED_OLDER_SDK]" mean in Android Studio? Android ADB device offline, can't issue commands Reading RFID with Android phones Android emulator: could not get wglGetExtensionsStringARB error No Activity found to handle Intent : android.intent.action.VIEW How to programmatically set drawableLeft on Android button? Android SDK Manager gives "Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml" error when selecting repository