ADB Android Device Unauthorized

后端 未结 30 1423
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 14:36

Since I reinstalled Eclipse (simply deleted and downloaded it again) I can\'t debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fin

相关标签:
30条回答
  • 2020-11-22 15:25

    I wasted hours on this stupid issue. None of the above solutions worked for me on their own.

    I'm running Windows 10. I had an old manual install of the Android SDK as well as Android Studio's SDK. I deleted my manually installed SDK and all my devices stopped working. These were the symptoms:

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

    as well as

    $ adb devices
    List of devices attached
    id1        unauthorized
    id2        unauthorized
    id3        unauthorized
    

    To be honest I'm not sure which of these steps got me my Allow USB debugging? prompts back so I listed EVERYTHING for completeness. Goes in order from easiest to hardest. Most people seem to be back on their feet after the first two sections.


    Restart ADB

    I would perform this after each of the sections below.

    adb kill-server
    adb usb
    

    Go crazy with developer options

    1. Turn Developer options off and back on
    2. Turn USB debugging off and back on
    3. Revoke USB debugging authorizations. Try this while USB debugging is on and if possible try also when USB debugging is off.

    Replug devices

    1. Unplug and replug USB cable into phone.
    2. Switch physical ports on your PC that your USB cable is connected into
    3. Switch physical USB cables you're using to connect your devices

    Start rebooting everything

    1. Reboot all your devices and connect again
    2. Reboot your PC
    3. Toggle WIFI on and off

    Start deleting things

    1. CAUTION Delete your ~/.android folder. Sometimes this folder can have the wrong permissions which can cause issues. You might want to back this folder up first.
    2. Uninstall all manufacturer specific drivers from add/remove programs. I uninstalled the following (names are not exact)
      • LG United USB Driver
      • HTC Mobile USB Driver
      • OnePlus USB Drivers 1.00
      • Samsung USB Driver
    3. I also uninstalled all emulators and their respective drivers (optional)
      • Nox & related drivers
      • Bluestacks
      • Genymotion

    Erase all Android related environment variables.

    1. Delete %ANDROID_HOME% if you have it set
    2. Delete %ANDROID_SDK_HOME% if you have it set

    At this point all my devices magically came to life and started displaying the Allow USB debugging? prompts and connecting properly through ADB. If you've made it this far and haven't found a solution, I am truly sorry you're in this predicament. Make sure you've restarted all devices and your dev machine at the end of all of these steps and connect to a fresh USB port using a new cable.

    If that still doesn't work try some of these other SO posts on the subject:

    • Android ADB device offline, can't issue commands
    • Can't connect Nexus 4 to adb: unauthorized
    • How to solve ADB device unauthorized in Android ADB host device?
    0 讨论(0)
  • 2020-11-22 15:25

    Had similar issue on osx and Nexus 5 (A6.0.1). I did get the authorization pop-up and confirmed it, despite that Android Studio nor any other IDE could connect to device.

    Turned out my Nexus (rooted) was missing key files.

    • Rebooted Android device into recovery
    • Ran code pasted below
    • Rebooted Android device, adb now identifies device

    Push key from computer to Android device:

     cd ~/.android && adb push adbkey.pub /data/misc/adb/adb_keys
    

    Solution came from here

    0 讨论(0)
  • I just try adb kill-server, it works for me:

    PS C:\Users\languoguang> adb devices
    List of devices attached
    MKJ0117A19000186        unauthorized
    PS C:\Users\languoguang> adb shell
    error: device unauthorized.
    This adb server's $ADB_VENDOR_KEYS is not set
    Try 'adb kill-server' if that seems wrong.
    Otherwise check for a confirmation dialog on your device.
    

    kill and start adb server:

    PS C:\Users\languoguang> adb kill-server
    PS C:\Users\languoguang> adb start-server
    * daemon not running; starting now at tcp:12345
    * daemon started successfully
    PS C:\Users\languoguang> adb devices
    List of devices attached
    MKJ0117A19000186        device
    
    0 讨论(0)
  • 2020-11-22 15:27

    The same issue started appearing once I changed my development device, it was solved as:

    $ mv ~/.android/adbkey ~/.android/adbkey.old
    $ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
    $ adb kill-server
    $ adb start-server
    
    0 讨论(0)
  • 2020-11-22 15:27

    This is error because your window version haven't driver for usb 3.0 to receiver authenticate permission from phone. I spent 5 day with this bug. Now, install 58964_Intel(R)_USB_3.0 driver. And continue with awesome code!

    i use this link to download driver

    0 讨论(0)
  • 2020-11-22 15:28

    It's likely that the device is no longer authorized on ADB for whatever reason.

    1. Check if authorized:

    <ANDROID_SDK_HOME>\platform-tools>adb devices
    List of devices attached
    4df798d76f98cf6d        unauthorized
    

    2. Revoke USB Debugging on phone

    If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).

    3. Restart ADB Server:

    Then restarted adb server

    adb kill-server
    adb start-server
    

    4. Reconnect the device

    The device will ask if you are agree to connect the computer id. You need to confirm it.

    5. Now Check the device

    It is now authorized!

    adb devices
    <ANDROID_SDK_HOME>\platform-tools>adb devices
    List of devices attached
    4df798d76f98cf6d        device
    
    0 讨论(0)
提交回复
热议问题