sodcalculator

10 Tech How-To

Fix ADB Device Unauthorized on Windows

Guide 10-48555 · Updated · Step by step

If you see “device unauthorized” when running ADB commands on Windows, it means your computer is not trusted by your Android device. The fix is to revoke USB debugging authorizations on the phone and re-authorize the connection, then restart the ADB server. This article explains why the error happens and walks through the complete solution, including common pitfalls and alternatives.

What Causes the ADB Unauthorized Error

ADB (Android Debug Bridge) is a command-line tool that lets your Windows PC communicate with an Android device for development, troubleshooting, or file management. When you connect a phone and enable USB debugging, the device shows a dialog asking you to allow USB debugging from this computer. If you click “OK” while also checking “Always allow from this computer,” the authorization is stored as an RSA key fingerprint on the phone.

The “unauthorized” message appears when that stored key is missing or mismatched. Common reasons include:

  • You previously clicked “Deny” or dismissed the dialog.
  • The phone’s USB debugging authorization was revoked (via developer options).
  • You changed the ADB key file on your PC (e.g., after reinstalling the platform-tools or using a different user account).
  • The phone’s system cached an old key after a ROM update or factory reset.
  • You are using a USB cable that only charges and does not carry data.

Sometimes the dialog simply doesn’t appear because the phone is locked, or because the connection is in the wrong USB mode (e.g., “Charge only” instead of “File Transfer”).

Prerequisites: What You Need

Before attempting the fix, ensure you have the following:

  • ADB installed on Windows – Download the official Android SDK Platform Tools from the Android developer site and extract them to a folder like C:\adb. You can also install them via a package manager like Chocolatey.
  • USB debugging enabled on the phone – Go to Settings > About phone and tap Build number seven times to unlock Developer options. Then go to Settings > Developer options and turn on USB debugging.
  • A working USB data cable – Try a different cable if you are unsure. A cable that only charges will not establish a data connection.
  • Phone unlocked – When you connect the phone, it must be unlocked so the authorization dialog can appear.

Step-by-Step Fix: Revoke and Reauthorize

Follow these steps in order. They work for Windows 10 and Windows 11, and for most Android versions (Android 6 through 14).

  1. Disconnect the phone from your PC.
  2. On the phone, go to Settings > Developer options and tap Revoke USB debugging authorizations. Confirm if prompted. This clears all stored RSA keys.
  3. On your PC, open a Command Prompt or PowerShell in the folder where ADB is located (or add that folder to your PATH).
  4. Run the command: adb kill-server – this stops the ADB server.
  5. Run: adb start-server – this restarts the server with a fresh state.
  6. Connect the phone to the PC with a USB cable. Make sure the phone is unlocked and set to “File Transfer” (or “MTP”) mode in the USB notification.
  7. Check the phone screen – a dialog should appear asking “Allow USB debugging?” with a checkbox for “Always allow from this computer.” Check the box and click Allow.
  8. On your PC, run: adb devices – you should now see your device listed as device instead of unauthorized.

If the dialog does not appear, try unplugging and re-plugging the cable, or toggle USB debugging off and on. Also make sure the phone is not in “Charging only” mode.

What If the Error Persists?

If you still see “unauthorized” after the steps above, try these additional fixes:

  • Delete the ADB key files on your PC. The keys are stored in %USERPROFILE%\.android\adbkey and adbkey.pub. Close ADB, delete these files, then restart the server. This forces the PC to generate a new key, which the phone will see as a new computer.
  • Update your ADB tools. Older versions may have bugs. Download the latest platform-tools from the official source.
  • Try a different USB port. Some ports (especially front-panel or USB 3.0) can be unreliable. Use a rear USB 2.0 port if possible.
  • Check the cable. A damaged or low-quality cable can cause intermittent data issues. Test with a known-good cable.
  • Restart both devices. Reboot your phone and your PC. Sometimes a simple restart clears stale processes.
  • On the phone, forget the USB connection. In Developer options, tap Select USB configuration and choose MTP (or File Transfer). Also try toggling USB debugging off and on.

If you are using a third-party tool like a phone manager or a custom ADB wrapper, make sure it is not interfering. Close all other programs that might be using ADB (like Android Studio, scrcpy, or file managers).

Common Mistakes and Misconceptions

Many users think the error is a driver problem, but it is almost always an authorization issue. Drivers are needed for the device to be recognized, but the “unauthorized” message means Windows sees the device and ADB sees it, but the phone has not approved the PC’s key.

Another common mistake is forgetting to unlock the phone. The authorization dialog will not appear if the screen is off or locked. Also, some phones have a setting called “USB debugging (Security settings)” that must be enabled for certain operations – but that is not required for basic authorization.

Do not click “Deny” on the dialog accidentally. If you do, repeat the revoke process. Also, note that the “Always allow” checkbox is essential if you want to avoid the prompt every time. If you skip it, you may need to re-authorize after each reboot.

Alternatives and Related Tools

If ADB continues to give you trouble, there are alternatives:

  • Wireless ADB – On Android 11 and later, you can enable Wireless debugging in Developer options and pair using a QR code. This avoids USB cable issues entirely.
  • scrcpy – This tool uses ADB to mirror your phone screen on Windows. It still requires ADB authorization, but it provides a GUI and can be easier for some tasks.
  • Android Studio – The full IDE includes a device manager that handles ADB automatically. If you are developing, this might be simpler.
  • Third-party ADB GUIs – Tools like Minimal ADB and Fastboot or QtADB provide a graphical interface, but they still rely on the same underlying ADB server.

Remember that the core fix is always the same: revoke on the phone, restart the server on the PC, and re-authorize. Once you understand that, the error becomes easy to resolve.

Frequently Asked Questions

Why does my phone not show the USB debugging prompt?

The most common reason is that the phone is locked or the screen is off. Unlock the phone and try again. Also check that USB debugging is actually enabled in Developer options, and that the USB connection mode is set to “File Transfer” (MTP) rather than “Charge only.” If you have previously revoked authorizations, the prompt should appear after reconnecting.

Do I need to install Google USB drivers on Windows?

For most modern Android phones, Windows will use a generic ADB interface driver that works automatically. If your device is not recognized at all (not even as an unknown device), you may need the manufacturer’s USB driver. But the “unauthorized” error specifically means the driver is working – the phone is just not approving the PC.

Can I fix this without a USB cable?

Yes, if your phone runs Android 11 or later, you can use Wireless debugging. In Developer options, enable Wireless debugging, then on your PC run adb pair ip:port and enter the pairing code shown on the phone. After pairing, you can connect with adb connect ip:port and authorize the connection on the phone. This bypasses USB entirely.

Will factory resetting my phone fix the unauthorized error?

A factory reset will clear all USB debugging authorizations, so yes, it would fix the error. But it is overkill and you will lose all data. The revoke step in Developer options achieves the same result without resetting the phone. Only consider a factory reset if you are stuck and have no other way to access Developer options.

Why does ADB work on one PC but not another?

Each PC has its own RSA key pair. The phone stores a list of trusted keys. When you connect a new PC, the phone sees an unknown key and asks for authorization. If you previously denied it on that PC, or if the key was deleted, you will get the unauthorized error. The fix is to revoke all authorizations on the phone and re-allow the new PC.

Is it safe to delete the adbkey files?

Yes, it is safe. The adbkey and adbkey.pub files are only used to identify your PC to Android devices. Deleting them forces ADB to generate a new key pair. You will need to re-authorize all devices you connect to, but no data is lost. This is a standard troubleshooting step recommended by many developers.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →