Understanding the 'ADB Devices Unauthorized' Error
If you're an Android developer or enthusiast, you might have encountered the frustrating 'unauthorized' status when running the adb devices
command. This error indicates that your Android device is not granting permission to your computer for debugging purposes. While the device appears in the list, it's marked as 'unauthorized', preventing you from executing commands like adb shell
, adb push
, or adb install
.
This issue can arise due to various reasons, including USB debugging settings, RSA key mismatches, or even device-specific quirks. Fortunately, this guide provides a comprehensive, step-by-step approach to resolve the 'unauthorized' error across different platforms.
Step-by-Step Guide to Fix 'ADB Devices Unauthorized' Error
1. Enable USB Debugging on Your Android Device
Before connecting your device, ensure that USB debugging is enabled:
-
Open Settings on your Android device.
-
Navigate to About phone and tap on Build number seven times to unlock Developer options.
-
Go back to the main settings menu and select Developer options.
-
Toggle on USB debugging.
On some devices, you may also need to enable Allow ADB debugging in charge only mode or Always prompt when connecting to USB.
2. Revoke USB Debugging Authorizations
To clear any existing authorizations:
-
In Developer options, tap on Revoke USB debugging authorizations.
-
Reconnect your device to your computer.
-
A prompt should appear on your device asking to allow USB debugging.
-
Check Always allow from this computer and tap OK.
3. Restart ADB Server
Sometimes, restarting the ADB server can resolve authorization issues:
-
Open a terminal or command prompt on your computer.
-
Run the following commands:
adb kill-server adb start-server adb devices
This sequence restarts the ADB server and reinitializes the connection.
4. Update or Reinstall ADB Drivers (Windows)
On Windows, outdated or missing drivers can cause authorization problems:
-
Open Device Manager.
-
Locate your Android device under Portable Devices or Other devices.
-
Right-click and select Update driver.
-
Choose Search automatically for updated driver software.
-
If no update is found, uninstall the device and reinstall the latest drivers from the manufacturer's website.
5. Delete ADB Keys
Corrupted ADB keys can lead to authorization issues:
-
Navigate to the ADB key directory on your computer:
-
Windows:
C:Users<YourUsername>.android
-
macOS/Linux:
~/.android/
Reddit
-
-
Delete the
adbkey
andadbkey.pub
files. -
Reconnect your device and authorize the connection when prompted.
6. Check for RSA Key Fingerprint Prompt
Ensure that the RSA key fingerprint prompt appears on your device:
-
If the prompt doesn't appear, try connecting your device to a different USB port or using a different USB cable.
-
If the prompt appears but you don't see the option to always allow, ensure that Always allow from this computer is checked before tapping OK.
7. Use the Correct ADB Command
When your device is in recovery mode, use the -d
flag with ADB commands:
adb -d sideload <filename.zip>
This specifies the device to use when multiple devices are connected.
8. Disable Wireless Debugging (If Applicable)
In some cases, wireless debugging can interfere with USB connections:
Open Android Studio.
Navigate to Settings > Build, Execution, Deployment > Debugger.
Uncheck Enable ADB mDNS for wireless debugging.
This setting can resolve issues where ADB over Wi-Fi conflicts with USB connections.
Troubleshooting Tips
Try a Different USB Cable: Some cables are charge-only and don't support data transfer.
Use a Different USB Port: Front ports on desktops may not provide a stable connection.
Check for Device-Specific Issues: Some devices may require specific steps to enable USB debugging or may have unique quirks.
Stay Tuned...
If you're still encountering issues or need assistance with a specific device, stay tuned for our upcoming articles where we'll delve deeper into device-specific solutions and advanced troubleshooting techniques.
✅ Frequently Asked Questions (FAQs)
❓What does 'ADB devices unauthorized' mean on Android?
Answer:
When you see 'unauthorized' next to your device after running the adb devices
command, it means your Android device hasn't approved the connection request from your computer. This usually happens when you haven’t accepted the RSA key fingerprint prompt on your phone, or when your computer's ADB keys are not recognized or have become corrupted.
❓How do I authorize my Android device with ADB?
Answer:
To authorize your Android device, ensure USB debugging is enabled in Developer Options. Then connect your device to your computer with a USB cable. A prompt will appear on your phone asking if you trust the computer. Tap Allow or Always allow from this computer, and then OK. This adds your computer's ADB key to the trusted list and removes the 'unauthorized' status.
❓Why is my device not showing the ADB authorization prompt?
Answer:
This can happen if:
You're using a defective or charge-only USB cable.
Your device is in a locked or sleep state.
The ADB server isn't running properly.
You've already dismissed the prompt by mistake.
Try using a different USB cable or port, restarting ADB using adb kill-server
followed by adb start-server
, and replugging the device with the screen unlocked.
❓How can I reset or revoke previous ADB authorizations?
Answer:
Go to Settings > Developer Options on your Android device and tap on Revoke USB debugging authorizations. This clears all previously trusted computers. The next time you connect your device via USB, the RSA fingerprint prompt will reappear, allowing you to reauthorize the current computer.
❓Can I fix ADB unauthorized without revoking USB debugging?
Answer:
Yes, in some cases, restarting the ADB server or reconnecting the device can trigger the RSA prompt without revoking all previous authorizations. However, if your device still doesn’t prompt, revoking USB debugging is usually the quickest and cleanest solution.
❓Is it safe to delete adbkey files from my computer?
Answer:
Yes, deleting adbkey
and adbkey.pub
from the .android
folder on your computer is safe. These are just the RSA keys that ADB uses to authenticate with devices. When you delete them, your computer will generate new keys the next time you use ADB, and your device will prompt you to reauthorize the connection.
❓Can I use ADB wirelessly if my USB connection is unauthorized?
Answer:
Unfortunately, no. To enable ADB over Wi-Fi, you first need a working USB debugging session to pair the device initially. If your USB is unauthorized, you must resolve the USB issue before you can set up wireless ADB debugging.
Discover more from 9Mood
Subscribe to get the latest posts sent to your email.
0 Comments