Being an open-source platform, Android supports a command-line tool called Android Debug Bridge. ADB is a versatile tool that can be used to perform a variety of tasks on Android devices using a Windows, Linux, macOS, or ChromeOS computer. In order that your PC can access your device and control it via ADB, you need to authorize the PC on your Android phone or tablet. For security reasons, ADB authorization is mandatory if you want to do things on your device via ADB commands. In this tutorial, we’ll see how we can authorize ADB on Android and fix the ADB device unauthorized error.
ADB can be used for several purposes. For example, you can use it to transfer files between your Android device and computer, install or uninstall apps, capture screenshots or record screens, get detailed information about your device, debug and fix problems, generate system logs, run ADB shell commands, root Android devices, enable and disable OS features, install OTA zip packages, back up data, control your device remotely, and so on. ADB might even come in handy, especially in situations where your phone is unusable.
To do all such things, you’ll have to use ADB commands. In order that ADB can communicate with your Android device you will need to allow the USB debugging permission for your Windows, Linux, or Mac computer. If you don’t do that, any ADB command that you execute either won’t work at all or throw the “adb device unauthorized” error:
This adb server's $ADB_VENDOR_KEYS is not set Try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device.
In many cases, users get the “ADB device unauthorized” error. To fix such issues, your must follow the proper steps to fix the ADB device unauthorized error on Windows, macOS, or Linux. Actually, it’s very easy to fix the ADB device unauthorized error. If ADB is unable to detect or connect to your Android device, there could be one of the following issues you need to address.
- Faulty USB connection
- USB debugging is not enabled on your device
- RSA key fingerprint not allowed
- USB drivers need to be updated
- Latest ADB drivers are not installed
Why Should We Keep USB Debugging Enabled?
ADB works as a bridge between your Android device and your computer. Google has implemented debugging authorization as a security measure so that no unauthorized computer can access your device over a USB connection without your permission. You can authorize a computer for single-time access, or just grant it permanent authorization for future access. In case you want to remove a computer from the list of approved devices, you can easily revoke USB debugging authorizations whenever you want to.
ADB authorization works as a primary firewall because it can be authorized only when the Android device is unlocked. If you have enabled screen lock, no one other than a hardcore hacker can control your device via ADB commands. Some people might say that keeping USB debugging enabled all the time is not safe. I think as long as you keep a screen lock method enabled, it is completely safe. On the contrary, USB debugging is one of those features that must be kept enabled. In certain tricky situations, ADB might turn up as your last resort to help fix your phone with a broken screen or power or volume buttons. If it is not enabled, you’ll get the ADB device unauthorized error because debugging is not enabled on your device. Remember, you won’t be able to enable USB debugging on Android from a computer or authorize an ADB device with a broken screen when your phone is locked.
As I clarified above, it’s very important that the USB debugging option is enabled on the Android device otherwise ADB will not detect it at all. If you follow the steps described below carefully, you can fix the ADB device unauthorized error easily.
Steps to Enable Developer Options and USB Debugging
The developer options on Android are not meant for normal users. As their very name suggests, there are supposed to be used by developers and geeks. By default, these options remain hidden from the Android settings menu but they can be easily activated by enabling the Developer mode. If you have already enabled debugging on your device, you can skip this part.
- Open the Settings app on your Android phone or tablet.
- Look for About, About phone, or About device in the settings menu. Usually, it’s located at the end of the settings menu. If you are unable to find it, tap the search box in the Settings app, type “about” and you’ll find it.
- Now, tap on Software information.
- On the next screen, tap on Build number 7 times in a row.
- You’ll see a toast message saying, “Developer mode has been turned on“.
- Now go back to the Settings menu and you’ll find a new item named Developer options listed there. On Android devices from Chinese OEMs, you might find it under Settings > Additional settings.
- Open the Developer options and go to the USB debugging option. Tap on the toggle button next to USB debugging and tap on OK when prompted to turn it on.
Revoking ADB Authorizations on Android
Before you try to fix the ADB device unauthorized error, you should start by revoking all previous ADB device authorizations on your Android device. To remove any ADB device or computer, follow the steps given below.
- Go to Settings> Developer options on your phone.
- Right below the option to USB debugging option, tap the Revoke USB debugging authorizations.
- A pop-up will appear. Just tap on OK to revoke ADB authorization access for all computers you authorized on your Android device in the past.
Setting up ADB on Windows, Mac, & Linux
Now that you have turned on the Developer options and enabled USB debugging on your Android phone or tablet, ADB can detect it when connected via USB to a Windows, Linux, or Mac computer. However, you won’t be able to send or execute ADB commands from your PC unless you authorize the ADB command on your device.
In order to authorize ADB commands, you’ll need to connect your device to your computer and issue a command. And, to do so, you’ll have to set up ADB and Fastboot drivers first. Depending on your computer OS, the method to install and set up ADB may differ. I have already detailed tutorials about settings up ADB and Fastboot on Windows, macOS, and Linux. You should start by downloading the latest Android SDK platform tools for your computer’s OS.
- Installing ADB and Fastboot on Windows 10 and 11
- Steps to Set up ADB and Fastboot on macOS
- Guide to Install ADB and Fastboot on Linux
Authorizing ADB Device on Android
Well, having enabled the USB debugging on your phone and set up the ADB drivers on your computer, let’s move to the final action.
- Open device settings, go to Display, and increase the screen timeout to 10 minutes. You have to make sure that your phone’s screen is not locked while you issue the ADB command on your PC.
- Connect your Android phone or tablet to your computer using a USB cable.
- Navigate to the platform-tools folder and open it.
- Now, launch a Command Prompt or PowerShell window with the folder path. That means you have to open the Command Prompt inside the folder window. There are 2 quick ways to do that.
- Place the mouse pointer inside the platform-tools folder window, right-click in any empty space, and select the “Open PowerShell window here” (Windows 10), or “Open in Terminal” (Windows 11) option from the Windows Context Menu.
- Type “cmd” or “powershell” in the folder window address bar and press the Enter key.
- If you’ve done it correctly you’ll see the path of the platform-tools folder in the Command Prompt window as shown below.
- Now, unlock your phone’s screen, type the following ADB command in the Command Prompt window, and hit the Enter key.
- Just as you press the Enter key, you’ll see a notification pop-up on your Android device saying, “Allow USB debugging?“. If you want to add your Windows PC to the list of authorized ADB devices for your Android phone, select the Always allow from this computer option and tap on Allow.
- As soon as you select Allow on your phone, you’ll see your device right under the List of devices attached in the Command Prompt window. Remember, ADB doesn’t show your device by its name or model number but by device ID which consists of a string of alphanumeric values.
- In case you fail to Allow USB debugging on your phone’s screen, you will get the unauthorized device error in the command window.
Disabling ADB Authorization Timeout in Android
Please note that even when you select the “Always allow from this computer” option while authorizing ADB, your device will remember your computer only for 7 days. If you try to use ADB commands from the same computer after that period, you’ll have to authorize it again. In order to give your computer permanent authorization on your Android devices for ADB-related tasks, follow the steps given below.
- Navigate to Settings> Developer options on your Android phone or tablet.
- In the Debugging section of the Developer options menu, you will find an option called Disable ADB Authorization Timeout. Just tap the toggle button next to this option and your device will save your PC as an authorized ADB device and remember its RSA key fingerprint in the future.