Android ADB devices unauthorized

梦想的初衷 提交于 2019-11-26 19:58:34
  1. Try Revoke USB DEBUGGING Authorization.
  2. Enable USB debugging again.

It worked.

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.

in Developer options,

  1. Enable USB debugging.

  1. Give a authorization.

(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.)

In sequence:

    adb kill-server
  • in your DEVICE SETUP, go to developer-options end disable usb-debugging

  • press REVOKE USB debugging authorizations, click OK

  • enable usb-debugging

    adb start-server
    

I removed the following files from the ~/.android folder:

  • adbkey
  • adbkey.pub

I disabled and enabled ADB within device and now it works...

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.

Try this uncheck the "verify apps via USB" in developer options and then turn on and off the "USB Debugging". It works with me.

In Android studio, Run menu > Run shows OFFLINE ... for the connected device.

Below is the procedure followed to solve it:

  1. (Read the below note first) Delete the ~/.android/adbkey (or, rename to ~/.android/adbkey2, this is even better incase you want it back for some reason)
    Note: I happened to do this step, but it didn't solve the problem, after doing all the below steps it worked, so unsure if this step is required.

  2. Run locate platform-tools/adb
    Note: use the path that comes from here in below commands

  3. Kill adb server:
    sudo ~/Android/Sdk/platform-tools/adb kill-server

  4. You will get a Allow accept.. message popup on your device. Accept it. This is important, which solves the problem.

  5. Start adb server:
    sudo ~/Android/Sdk/platform-tools/adb start-server

  6. In Android studio, do Run menu > Run again
    It will show something like Samsung ... (your phone manufacture name).
    Also installs the apk on device correctly this time without error.

Hope that helps.

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

All you need is to authorize debug mode.
1. make sure your Device is connected to your PC.
2. Allow authorized for debug mode via Android-Studio by going to
Run -> Attach debugger to Android process
than you will see the pop up window for allow debug mode in your Device,
press OK. done.
i hope it help to someone.

Anthony .M

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.

for anyone encountering this later this may also help. I encountered this exact issue trying to use adb from a user command prompt and the answers above did not help, but the problem went away with an "adb kill-server" when running in an administrator command prompt.

  1. First Remove the adbkey and adbkey.pub from the .android directory in your Home directory.
  2. Make .android directory in your home with 710 permissions: $ chmod 710 .android/ and ownership as: chown -R <user>:<user> .android/. Ex:

    $ chmod 710 .android/
    $ chown -R ashan:ashan .android/
    
  3. Go to developer options in your mobile and tap option Revoke USB debugging authorizations

  4. Turn off all USB Debugging and Developer Options in the device and disconnect the device from your machine.

  5. Connect the device again and at first turn on the Developer Options. Then Turn on the USB debugging.

  6. At this point in your mobile, you will get a prompt for asking permission from you. Note: you must check the checkbox always accept from this …. option and click ok.

  7. Now in you machine, start the adb server: adb start-server.

  8. Hopefully when you issue the command: adb devices now, you will see your device ready authorized.

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

.

I suppose you have enabled On-device Developer Options in your smartphone? If not you can take a look at the steps provided by Android, http://developer.android.com/tools/device.html#developer-device-options

I had this problem and it wasnt solved by the deleting of any keys (at least deleting them didnt fix it, maybe had an effect after i did fix it though)

I actually had a discrepancy between my sdk-tools version and my Android Studio version. After updating my tools it still didnt work, but after updating AS (to 1.4) everything worked fine again.

Always update both sdk-tools and AS version together ;)

Shadow Droid

Please try the instructions provided here: http://developer.android.com/tools/extras/oem-usb.html

Or else first you can manually add the vid and pid of device to <your SDK folder>\extras\google\usb_driver android_winusb.inf file as it is present for other Google devices. To find it, just go to Device Manager → Properties of Device → Details → Hardware Ids and then you can upgrade the driver as mentioned in the above link.

I am telling this because if you open android_winusb.inf you might find code:

;Google Nexus (generic) %SingleBootLoaderInterface% = USB_Install,
USB\VID_18D1&PID_4EE0 %CompositeAdbInterface% = USB_Install,
USB\VID_18D1&PID_4EE2&MI_01

which helps to detect any Google Nexus device. Similarly, you need to replicate for your device in that file. Example

;One plus %SingleBootLoaderInterface% = USB_Install,
USB\**user device hardware ids** %CompositeAdbInterface% = USB_Install,
USB\**user device hardware ids**
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!