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条回答
我想做一个坏孩纸
2楼-- · 2020-01-29 03:52
  1. Make sure adb is up to date
  2. Make sure you are using the google usb drivers: http://developer.android.com/tools/extras/oem-usb.html
  3. Make sure your ANDROID_SDK_HOME environment variable is set to the correct path
查看更多
神经病院院长
3楼-- · 2020-01-29 03:52

I had to re-install my adb driver to snap out of this probelm. I had install "Universal Naked Driver" in an effort to recover my phone. I uninstalled that and re-installed the driver out of the android sdk.

查看更多
我想做一个坏孩纸
4楼-- · 2020-01-29 03:52

Сhange USB connection mode from MTP to Camera (for Nexus 7) or, possibly, to Mass Storage or something else (for other devices). This option is usually under Settings -> Storage. Then connect the device again, you'll get the authorization dialog.

MTP has been known to interfere with USB debugging -- these two did not work together at all on majority of older devices. Nexus 7 and many newer devices do allow both to work alongside, but this particular issue suggests it's not all that smooth yet.

Bonus -- checklist for when adb is not behaving well:

  • adb kill-server followed by adb start-server
  • (on device) Settings -> Developer Options -> USB Debugging -- switch off and on
  • [Windows] Make sure you have the proper driver (your best bet is Universal Adb Driver by Koushik Dutta -- will handle any device)
  • [Windows] Try turning off all fancy on-the-fly anti-malware scanners/firewalls
  • [Linux] Make sure you have the proper UDEV rule in /etc/udev/rules.d/51-android.rules (again, universal solution: https://github.com/snowdream/51-android)
  • [Linux] Make sure everything under ~/.android is owned by you, not root (and upvote this answer)
  • restart device (yes, surprisingly, this is a valid measure, too)
  • (Obviously) replug cable, try different cable, different port, remove any extender cables
查看更多
疯言疯语
5楼-- · 2020-01-29 03:53

I was facing same, issue, I found I was using a simple usb cable which was meant for only charge and not data copy. using good usb cable solved my problem !

查看更多
6楼-- · 2020-01-29 03:53

1.) Delete ~/.android/adbkey on your desktop machine

2.) Run command "adb kill-server"

3.) Run command "adb start-server"

You should now be prompted to accept debug key.

查看更多
ゆ 、 Hurt°
7楼-- · 2020-01-29 03:54

I think it has an error when the device tries to display the screen asking for permission, so it does not appear.

This works for me (commands are given in the adb shell):

  1. rm /data/misc/adb/adb_keys;
  2. I sent the public key (adbkey.pub in ~/.android/) from my computer to my device via email;
  3. Invoke stop adbd;
  4. cat adbkey.pub >> /data/misc/adb/adb_keys (authorize myself);
  5. start adbd (restart adb with new keys).
查看更多
登录 后发表回答