Android ADB device offline, can't issue comman

2019-01-03 04:07发布

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.

30条回答
地球回转人心会变
2楼-- · 2019-01-03 05:01

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\
查看更多
淡お忘
3楼-- · 2019-01-03 05:02

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.

查看更多
冷血范
4楼-- · 2019-01-03 05:04

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.

查看更多
不美不萌又怎样
5楼-- · 2019-01-03 05:05

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.

查看更多
祖国的老花朵
6楼-- · 2019-01-03 05:07

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

查看更多
老娘就宠你
7楼-- · 2019-01-03 05:07

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"
查看更多
登录 后发表回答