本文共 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. 我尝试过的事情。
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. 然后重启。
参考:
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(一次更新自身),然后才能看到最新的软件包。
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: 现在我的开发工具是:
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 ;) 和往常一样,在开发人员选项中确认已启用调试;)
Try running adb devices
after running adb kill-server
. 在运行adb kill-server
之后,尝试运行adb devices
。 Security question pops up after that. 之后会弹出安全问题。 Worked for me. 为我工作。
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/