Error Code: error: device unauthorized. Please check the confirmation dialog on your device.

How to Fix "device unauthorized" in ADB

Fix RSA key authentication failures between your computer and Android phone.

Common Symptoms

  • `adb devices` displays device serial with status "unauthorized"
  • Commands fail with "error: device unauthorized"
  • Authorization prompt never pops up on the phone display

Root Causes

  • The RSA fingerprint dialog was dismissed or not accepted on the phone screen
  • Corrupted `adbkey` cryptographic key pair on the host computer
  • Revoked authorizations in Android Developer Options

Proven Solutions

Solution 1: Revoke USB Debugging Authorizations and Re-pair

Clears cached RSA tokens on device to force fresh handshake.

  1. Unplug USB cable from phone
  2. On phone: Settings > Developer options > Revoke USB debugging authorizations > OK
  3. Toggle "USB debugging" OFF, wait 3 seconds, toggle ON
  4. Plug USB cable back into phone and computer
  5. Unlock phone screen
  6. When dialog appears, check "Always allow from this computer" and tap "Allow"

Solution 2: Regenerate Host ADB RSA Keys

Deletes corrupted host adbkey files in user profile.

  1. Kill ADB server: `adb kill-server`
  2. Delete `~/.android/adbkey` and `~/.android/adbkey.pub` (on Windows: `C:\Users\<YourUser>\.android\adbkey*`)
  3. Restart server: `adb start-server`
  4. Reconnect phone and accept the newly generated key
adb kill-server
adb start-server
adb devices