keepcalculator

06 Numbers and Powers

ADB Device Unauthorized: Fix It in 6 Steps

Card No. 06·52014 · Updated · Standard formula, shown below

When you plug an Android phone into your computer and run ADB commands, you may see the error “device unauthorized”. This happens because the phone is asking you to confirm a debugging connection, and either you missed the prompt or the confirmation didn’t stick. This guide shows you how to clear the stale authorization and re-establish a trusted connection so ADB works again.

What You’ll Need

  • Android phone with USB debugging already enabled (Settings > Developer Options > USB debugging)
  • ADB tools installed on your computer (platform-tools from the Android developer site)
  • A USB cable that supports data transfer (not charge-only)
  • Access to the phone’s screen to tap confirmation dialogs

Step-by-Step

  1. Disconnect the phone from the computer. Unplug the USB cable.
  2. Open a command prompt or terminal on your computer in the folder where ADB is installed. On Windows, hold Shift and right-click the folder, then choose “Open command window here” or “Open PowerShell window here.” On macOS/Linux, open Terminal and navigate to the platform-tools folder.
  3. Revoke USB debugging authorizations on the phone. Go to Settings > Developer Options and tap Revoke USB debugging authorizations. Confirm the dialog. This clears all previously trusted computers.
  4. Restart the ADB server on your computer. In the command prompt, run:
    adb kill-server
    then
    adb start-server
  5. Reconnect the phone with the USB cable. Make sure the phone is unlocked and the screen is on.
  6. Check the phone screen for a dialog that says “Allow USB debugging?” with a checkbox for “Always allow from this computer.” Check the box and tap Allow.
  7. Verify the connection by running:
    adb devices
    You should see your device listed with the status device (not unauthorized).

Common Mistakes

  • Missing the prompt on the phone – The confirmation dialog appears on the phone, not the computer. If you don’t tap Allow, the status stays unauthorized.
  • Using a charge-only cable – Some cables only supply power. Use a cable known to transfer data.
  • Not unlocking the phone – The dialog may not appear if the screen is locked. Unlock the phone before connecting.
  • Forgetting to revoke old authorizations – If the phone already has a stale authorization, simply reconnecting may not trigger a new prompt. Revoking fixes that.
  • Running ADB as a different user – On Windows, if you run the command prompt as Administrator, the ADB key file is stored in a different location. Stick to the same user account.

Tips

  • Always check the “Always allow from this computer” box when the prompt appears to avoid repeated confirmations.
  • Keep your ADB tools up to date. Older versions may have bugs with newer Android versions.
  • If you use multiple computers, each will need to be authorized separately. Revoking on the phone clears all of them at once.
  • On some phones, you may need to enable USB debugging (Security settings) in addition to the regular USB debugging option, especially on Xiaomi or Oppo devices.

Troubleshooting

If the “Allow USB debugging” dialog never appears: Try toggling USB debugging off and on again in Developer Options. Also try switching USB modes on the phone (e.g., from “Charging” to “File Transfer” or “MTP”). Some devices only show the prompt in certain modes.

If the device still shows as unauthorized after following the steps: Repeat the process, but this time delete the ADB key file on your computer. On Windows, it’s in C:\Users\<username>\.android\adbkey and adbkey.pub. On macOS/Linux, it’s in ~/.android/. Delete both files, then run adb kill-server and adb start-server. This forces a fresh key pair, which usually resolves stubborn authorization issues.

If the phone shows as “offline” instead of “unauthorized”: Try a different USB port, preferably a USB 2.0 port directly on the motherboard. Also try a different cable. If that fails, restart both the phone and the computer.

If you’re using a Samsung phone: You may need to enable “USB debugging” in Developer Options and also set “USB configuration” to “MTP” or “PTP” in Developer Options. Some Samsung models require the phone to be unlocked and on the home screen when connecting.

Frequently Asked Questions

Why does ADB say “unauthorized” even after I tapped Allow?

This can happen if the authorization wasn’t saved properly. Revoking USB debugging authorizations and repeating the process usually fixes it. Also ensure you checked “Always allow from this computer.”

Do I need to root my phone to fix this?

No. The unauthorized message is a standard security feature. You don’t need root access to authorize ADB.

Will this erase my phone data?

No. Revoking USB debugging authorizations only removes the list of trusted computers. It does not affect your apps, photos, or settings.

Can I authorize ADB over Wi-Fi?

Yes, but the initial connection must be made over USB to authorize the computer. After that, you can use adb tcpip 5555 and connect wirelessly, but the authorization persists only until you revoke it.

Why does my phone show a different RSA key fingerprint each time?

Each computer has its own ADB key. If you use multiple computers, you’ll see different fingerprints. That’s normal. If the same computer shows a different fingerprint, the key file may have been deleted or regenerated.

Is it safe to check “Always allow from this computer”?

Yes, if it’s your own computer and you trust it. It means the computer can run ADB commands on your phone without asking again. Avoid checking it on public or shared computers.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →