博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android ADB设备离线,无法发出命令
阅读量:3581 次
发布时间:2019-05-20

本文共 3829 字,大约阅读时间需要 12 分钟。

本文翻译自:

I can't connect to my device anymore using through the command line or in . 我无法再通过命令行或在使用连接到我的设备。

Running the command 运行命令

adb devices

returns the device name, but it says it's offline. 返回设备名称,但表示它已脱机。

Things I've tried. 我尝试过的事情。

  1. Toggled Android debugging mode 切换Android调试模式
  2. Reinstalled the Google USB driver 重新安装了Google USB驱动程序
  3. Restored the OS to a previously working backup ( ) 将操作系统还原到以前可以正常工作的备份( )
  4. Swapped the USB cord 交换USB线
  5. Rebooted the phone/computer multiple times 多次重启手机/电脑
  6. Updated the Android SDK 更新了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. 要明确的是,如果您遇到相同的问题,则问题可能是过时的SDK。 As of 4.2.2 there is a security feature that requires you to confirm the RSA fingerprint of the connecting device. 从4.2.2开始,有一项安全功能要求您确认连接设备的RSA指纹。 Open the SDK manager and update the tools! 打开SDK管理器并更新工具! Then reboot. 然后重启。


#1楼

参考:


#2楼

I just got the same problem today after my and were updated to Android 4.2.2. 我将和更新到Android 4.2.2后,今天遇到了同样的问题。

The thing that fixed it for me was to upgrade the SDK platform-tools to r16.0.1. 对我来说固定的是将SDK平台工具升级到r16.0.1。 For me, this version was not displayed in my SDK Manager, so I pulled it down from directly. 对我而言,此版本未在我的SDK管理器中显示,因此我直接从将其下拉。

You then need to rename the platform-tools directory and unzip it to android-sdk-windows/platform-tools . 然后,您需要重命名platform-tools目录并将其解压缩到android-sdk-windows/platform-tools Using the SDK Manager, I had also updated to the latest sdk-tools before this. 在使用SDK Manager之前,我还更新了最新的sdk工具。

If your whole Eclipse and are ancient, you may need to update them as well, but I didn't need to. 如果您的整个Eclipse和都是古老的,则可能还需要更新它们,但我不需要这样做。

Note: you may need to run SDK Manager twice (once to update itself) before you will see the latest packages. 注意:您可能需要运行两次SDK Manager(一次更新自身),然后才能看到最新的软件包。


#3楼

I hit the same issue on a Nexus 7 running 4.2.2 OTA update. 我在运行4.2.2 OTA更新的Nexus 7上遇到了相同的问题。 I'm almost certain I had an ADB connection over USB and Wi-Fi after the update until it just stopped working. 我几乎可以肯定,更新之后我就通过USB和Wi-Fi建立了ADB连接,直到它停止工作为止。 To fix, I updated my SDK using: 要修复,我使用以下方法更新了我的SDK:

android update sdk --no-ui

Now my development tools are: 现在我的开发工具是:

  • SDK rev 16.0.2 SDK版本16.0.2
  • SDK tools rev 21.1 SDK工具21.1版
  • SDK API 17, rev 2 SDK API 17,修订版2

#4楼

For anyone wondering about 4.2.2, there is a security question that appears on the phone requesting RSA verification with the PC. 对于想知道4.2.2的任何人,电话上都会出现一个安全问题,要求与PC进行RSA验证。 Be sure your tools are updated AND you allow the PC access by verifying the security question on the devices in question. 确保您的工具已更新,并且通过验证有关设备上的安全性问题来允许PC访问。 This fixed it for me. 这为我解决了。

And as always, verify you have debugging enabled in the developer options ;) 和往常一样,在开发人员选项中确认已启用调试;)


#5楼

Try running adb devices after running adb kill-server . 在运行adb kill-server之后,尝试运行adb devices Security question pops up after that. 之后会弹出安全问题。 Worked for me. 为我工作。


#6楼

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: 在更新SDK并安装适用于4.2.2的API之后,需要执行的操作是:

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. 我遇到的另一个问题是我试图通过Wi-Fi连接ADB,这是我唯一的选择,因为Mac上的USB端口确实很灵巧。 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. 不幸的是,通过Wi-Fi的ADB在4.2.2中没有显示安全性问题,因此您需要找到一条可以正常工作的USB电缆并至少通过USB连接一次以接受安全性问题,但是在您执行一次之后,您可以通过Wi-Fi连接。

转载地址:http://cmlgj.baihongyu.com/

你可能感兴趣的文章
SQL where子句及查询条件语句(六)
查看>>
SQL 连接JOIN(九)
查看>>
linux VM虚拟机可以ping通主机,但主机无法ping通虚拟机
查看>>
C++ 中Struct与typedef struct总结
查看>>
WNetAddConnection2调用失败,错误码1200/1312
查看>>
POI读写Excel的基本使用
查看>>
淘宝网站的架构演进
查看>>
设置zookeeper开机自启动流程
查看>>
CentOS安装mysql5.7的教详细流程
查看>>
项目整合微信扫码登录功能
查看>>
分布式文件系统FastDfs的搭建
查看>>
Springboot项目利用Java客户端调用FastDFS
查看>>
全文检索工具elasticsearch的安装和简单介绍
查看>>
利用Kibana学习全文检索工具elasticsearch
查看>>
SpringBoot在Test测试类或自定义类中通过@Autowired注入为null
查看>>
使用docker搭建YAPI服务
查看>>
西南科技大学OJ题 邻接表到邻接矩阵1056
查看>>
西南科技大学OJ题 有向图的出度计算1057
查看>>
西南科技大学OJ题 有向图的最大出度计算1059
查看>>
西南科技大学OJ题 带权有向图计算1063
查看>>