1. Ask questions
When the computer connected a new Android device via USB and wanted to perform some operations through adb, I found that after entering the following command on the command prompt, the device was not authorized, that is, "unauthorized" information was displayed.
adb devices
2. Unfeasible solutions
The solution proposed by someone is to turn on USB debugging in the developer options of the Android device , but the author has turned it on before, so it can be seen that the problem is not related to this.
3. Problem solving
By consulting various information, I found a way to solve the problem, which requires the following steps:
1. Delete files related to C drive
Find the two files adbkey and adbkey.pub through the computer's C drive path and delete them
C:\Users\Administrator\.android
2. Android device revokes USB debugging authorization
Click on Revoke USB debugging authorization in the developer options of the Android device . I think this is to remove the previous settings so that it can be re-operated later.
3. Reconnect the Android device to the computer
If the Android device is still connected to the computer through the USB cable at this time, it needs to be unplugged first, and then re-plugged to reconnect to the computer.
4. Enter adb related commands
After the Android device reconnects to the computer, enter the following three commands in sequence at the computer's command prompt:
adb kill-server
adb start-server
5. Android device re-authorization
After entering the above two instructions, the Android device will pop up an authorization pop-up window, click OK.
6. Re-enter the adb command
After completing the above steps, you can re-enter the command and you will be able to successfully authorize it.
adb devices