Can't connect Nexus 4 to adb: unauthorized

2020-01-29 03:51发布

I have a Nexus 4 with Android 4.3 and I am trying to connect the device to a computer with Windows 7 64bit.

I installed the latest drivers and the latest adb version. I think I tried almost everything and I still get the following message:

C:\Program Files (x86)\Android\sdk\platform-tools>adb devices
List of devices attached
007667324ccb229b        unauthorized

What can be the reason for this error?

26条回答
SAY GOODBYE
2楼-- · 2020-01-29 04:09

When I turn off my Comodo Antivirus everything goes back normal. All other solutions suggested here went in vain. Somehow I figured out one solution.

If you are using Comodo Antivirus (Version 6.3/ For other versions search for similar options) the following solution would help you.

Open Comodo > Tasks > Advanced Tasks > Open Advanced Settings > Security Settings > Firewall > Firewall Settings > Advanced : Filter loopback traffic (e.g. 127.x.x.x, ::1)

Uncheck this "Filter loopback traffic" option, which prevents adb from normal working.

查看更多
Explosion°爆炸
3楼-- · 2020-01-29 04:09

Simply re-plugging did the trick for me.... The permissions-dialog didn't show up the first time I plugged in the device, the second time it did and everything is fine now.

查看更多
霸刀☆藐视天下
4楼-- · 2020-01-29 04:12

Similar to Flavio's answer (https://stackoverflow.com/a/18542792/1064996), it was something to do with the files in ~/.android (on the host machine, not the phone).

I didn't have ~/.android/adbkey, but I did have ~/.android/debug.keystore and my whole ~/.android directory was owned by root. I removed the keystore file and also changed ownership to me (sudo chown -R $USER ~/.android), killed the adb server and plugged in my phone, and it worked.

It was probably the ownership thing. Make sure you have read/write permissions in ~/.android

查看更多
一纸荒年 Trace。
5楼-- · 2020-01-29 04:12

Four easy steps

./adb kill-server ./adb start-server

replug the device, unlock it and accept the new key

查看更多
疯言疯语
6楼-- · 2020-01-29 04:15

Use a different USB cable. Some cables may not have all pins connected or whatnot, and while they work for image transfer, the debugging/adb does not work.

The bottom line: I kid you not. A cable which works for my phone (adb works) does NOT work for my tablet - the device is always offline or unauthorized and tablet pops out no dialog. I tried multiple reboots, settings, I went berserk in the process and cursed the bloody Android. Then accidentally I plugged in the cable which came with the tablet and suddenly it worked. My fascination with Android is definitely gone. What a stupid piece of junk.

查看更多
混吃等死
7楼-- · 2020-01-29 04:16

It happened for me after my backup software changed the permission to my user directory. I opened it in File Explorer, it prompted me to set permissions and it fixed the issue.

FYI: Android has a special directory under "\User\.android" If you can't access it, it won't prompt you.

查看更多
登录 后发表回答