Android ADB devices unauthorized

2020-01-24 04:05发布

Configuration:

  • Windows 8.1
  • ADB version: 1.0.32
  • Smartphone: Oneplus One

Problem

I installed the Samsung drivers as it is said to do. When I run the ADB devices command, it said unauthorized.

Already tried:

  1. I've done everything that'd been said on this post: https://stackoverflow.com/a/25546300/1848376

    But the problem is that I don't get a prompt on the phone to tell me I must accept the connection.

  2. When I run the command adb shell, here is the answer:

    error: device unauthorized.
    This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
    Otherwise check for a confirmation dialog on your device.
    

I did "adb kill-server", but it didn't change anything. Why?

20条回答
We Are One
2楼-- · 2020-01-24 04:25

I was hit by this problem, too. I'm using my custom build of AOSP on Nexus 5X. I've added a single line in build/core/main.mk:

diff --git a/core/main.mk b/core/main.mk
index a6f829ab6..555657539 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -362,6 +362,8 @@ else # !enable_target_debugging
   ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
 endif # !enable_target_debugging

+ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
+
 ## eng ##

 ifeq ($(TARGET_BUILD_VARIANT),eng)

Now adb shell works fine

Those materials are useful (Chinese articles): http://www.voidcn.com/blog/kc58236582/article/p-6335996.html, http://blog.csdn.net/fanmengke_im/article/details/28389439

查看更多
孤傲高冷的网名
3楼-- · 2020-01-24 04:26

Thankgod xda developers exist : http://forum.xda-developers.com/verizon-lg-g3/help/unable-to-access-adb-t2830087

Just had to delete adbkey file in C:Users/$Name/.android adbkey.pub was missing.

Restart after this and both files are there.

If this does not work : - Try Revoke USB DEBUGGING Authorization. - Enable USB debugging again.

查看更多
Animai°情兽
4楼-- · 2020-01-24 04:29

Try deleting the adbkey file from C/.android folder

and then run the commands as mentioned above i.e.

adb kill-server, adb start-server and adb devices

.

查看更多
Evening l夕情丶
5楼-- · 2020-01-24 04:31

Ensure that you have accepted the pressed the "ok" button when it is asking it is showing the fingerprint of the device after connecting through usb to your PC.

查看更多
女痞
6楼-- · 2020-01-24 04:31

I had the same problem after reinstalled my android studio. Here's what I did to make my adb work again:

-path to C:\Users\User\AppData\Local\Android\sdk\platform-tools
-Shift+r.click and start command from here instead.
查看更多
7楼-- · 2020-01-24 04:33

in Developer options,

  1. Enable USB debugging.

enter image description here

  1. Give a authorization.

enter image description here

(if there is no a Developer option menu, you have to click 3 times build number of Phone State menu to be developer. you can sse a developer option menu.)

enter image description here

查看更多
登录 后发表回答