‘Android ADB Devices Unauthorized’ Error

Best solutions to fix the 'unauthorized' ADB device error on Windows, macOS, and Linux, ensuring seamless Android development and debugging.4 min


Android-ADB-Devices-Unauthorized

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:

  1. Open Settings on your Android device.

  2. Navigate to About phone and tap on Build number seven times to unlock Developer options.

  3. Go back to the main settings menu and select Developer options.

  4. 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:

  1. In Developer options, tap on Revoke USB debugging authorizations.

  2. Reconnect your device to your computer.

  3. A prompt should appear on your device asking to allow USB debugging.

  4. Check Always allow from this computer and tap OK.

3. Restart ADB Server

Sometimes, restarting the ADB server can resolve authorization issues:

  1. Open a terminal or command prompt on your computer.

  2. 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:

  1. Open Device Manager.

  2. Locate your Android device under Portable Devices or Other devices.

  3. Right-click and select Update driver.

  4. Choose Search automatically for updated driver software.

  5. 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:

  1. Navigate to the ADB key directory on your computer:

    • Windows: C:Users<YourUsername>.android

    • macOS/Linux: ~/.android/Reddit

  2. Delete the adbkey and adbkey.pub files.

  3. 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.

adsense


Discover more from 9Mood

Subscribe to get the latest posts sent to your email.


Like it? Share with your friends!

What's Your Reaction?

Lol Lol
0
Lol
WTF WTF
0
WTF
Cute Cute
0
Cute
Love Love
0
Love
Vomit Vomit
0
Vomit
Cry Cry
0
Cry
Wow Wow
0
Wow
Fail Fail
0
Fail
Angry Angry
0
Angry
Being Coders

Newbie

A Tech publication for all. Get Knowledge about Web Development, Programming, and trending news, tutorials, and tools for beginners to experts.

0 Comments

Leave a Reply

Choose A Format
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Ranked List
Upvote or downvote to decide the best list item
Open List
Submit your own item and vote up for the best submission
Countdown
The Classic Internet Countdowns
Meme
Upload your own images to make custom memes
Poll
Voting to make decisions or determine opinions
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Personality quiz
Series of questions that intends to reveal something about the personality
is avocado good for breakfast? Sustainability Tips for Living Green Daily Photos Taken At Right Moment