Why does the device unauthorized error occur?
The device unauthorized error in the adb devices output means that the ADB server on your computer cannot establish a secure connection with the device. This is not a driver failure or a missing cable—it's a protective mechanism in Android, starting from version 4.2.2.
Every time a new computer attempts to connect via USB debugging, Android must explicitly permit this access. The permission is stored in the system using a debugging key. If you previously clicked "Cancel" or reset developer settings, the "Always allow from this computer" checkbox was not set, and upon the next connection, ADB receives the unauthorized status.
Typical symptoms
- In the terminal:
adb devicesshowsunauthorizedinstead ofdevice. - The standard "Allow USB debugging?" dialog does not appear on the phone screen.
- The device is listed in
fastboot devices, but not inadb devices. - The issue occurs only on one specific PC; debugging works on another.
5 Proven Solutions
Solution 1: Hardware Check and Basic Restart
Start with the simplest—hardware-related causes.
- Cable: Use the device's original cable or a high-quality data-supporting alternative. Many cheap cables only have power lines.
- Port: Connect the cable directly to a port on the computer's motherboard, avoiding USB hubs.
- Restart ADB: In the terminal/command prompt, run:
adb kill-server adb start-server adb devices - Reconnect the device, having first unlocked the screen (PIN/pattern).
After this, the debugging authorization dialog should appear on the device. Be sure to check the "Always allow from this computer" box and tap "OK".
Solution 2: Recreate the Authorization Key on the Device
If the authorization window doesn't appear, reset the saved keys on the device itself.
- Open Settings → Developer options (if not visible, enable it by tapping "Build number" in "About phone" 7 times).
- Find the "Revoke USB debugging authorizations" option.
- Confirm the reset.
- Turn off and back on the "USB debugging" option.
- Reconnect the device to the computer.
The system will delete the old keys, and the permission request will appear again upon the next connection.
Solution 3: Change USB Mode and Reboot the Device
Sometimes the conflict arises from the selected connector mode.
- With the cable connected, pull down the notification shade on the device.
- Tap the "USB for charging" (or "USB connection") notification.
- Select "File Transfer (MTP)" or "Transfer files".
- Reboot both the phone and the computer.
- After booting, check
adb devicesagain.
For some firmware (MIUI, EMUI), you need to go to Settings → Additional settings → Developer options and enable "USB debugging (Security settings)" as a separate option.
Solution 4: Manually Adding the Authorization Key (Advanced)
If none of the above worked, the key file on the device might be corrupted. Root access is required.
- Install a file manager with root access on the device (e.g., Solid Explorer).
- Navigate to the
/data/misc/adb/folder (or/data/adb/on some firmware). - Find the
adb_keysandadb_keys.pubfiles. Delete them. - Reboot the device.
- Enable USB debugging and connect to the PC—the authorization window will reappear.
This method is impossible without root.
Solution 5: Reset Developer Settings and Factory Reset (Last Resort)
If the problem persists, the system developer settings might be corrupted.
- In Settings → Developer options, find "Reset developer options" and perform the reset.
- Disable and re-enable developer mode (tap "Build number" 7 times again).
- Re-enable "USB debugging".
- If that didn't help—perform a factory data reset (Settings → System → Reset → Factory data reset). All data will be erased! Create a backup beforehand.
After the reset, the developer settings will "forget" the old keys, and authorization will work with the new PC.
Preventing the Problem
- Always check the "Always allow from this computer" box upon first connection.
- Avoid turning off "USB debugging" unnecessarily.
- Use high-quality data-supporting cables.
- When changing PCs or reinstalling the OS, be prepared for re-authorization.
What to Do If the Problem Persists?
If none of the solutions helped, check:
- ADB drivers on your computer (for Windows, use SDK Platform-Tools or Universal ADB Driver).
- Firmware specifics—on Xiaomi/Redmi/Realme, you often need to separately enable "USB debugging (Security settings)" and "Install via USB".
- The condition of the device's USB port—mechanical damage or dirty contacts.
For devices with a locked bootloader and custom firmware (LineageOS, Pixel Experience), you may need to manually install the key via recovery or re-flash adb_keys.