ADB Android Device Unauthorized

后端 未结 30 1713
伪装坚强ぢ
伪装坚强ぢ 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?

提交回复
热议问题