scrcpy: device unauthorized.

Huawei Mate 20 Pro

Dev Settings/USB Debugging = on

I get this:

adb: error: failed to get feature set: device unauthorized.
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.
ERROR: "adb push" returned with value 1
Press any key to continue...

PS C:\scrcpy-win64> adb devices
List of devices attached
adb server version (40) doesn't match this client (39); killing...
* daemon started successfully
LHS7N*************        unauthorized

PS C:\scrcpy-win64>

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

If the device is in unauthorized state as listed by adb devices (i.e. if USB debugging is enabled but not allowed on the device), then you can do the following steps.

  1. plug the device: this will open a popup (that you don’t see if your screen is broken)
  2. run scrcpy --otg (see OTG)
  3. press <kbd>Tab</kbd>, <kbd>Enter</kbd>, <kbd>Tab</kbd>, <kbd>Tab</kbd>, <kbd>Enter</kbd> (this enables “Always allow from this computer” and clicks on OK)

Now your device is authorized. You can run scrcpy.

You have two problems here:

  1. You already have some adb daemon v39 running on your computer (something which uses adb). If this running daemon is not reexecuted as soon as it is killed, executing adb devices one more time should not print adb server version (40) doesn't match this client (39); killing.... You should find the software which executes adb v39.
  2. Device is unauthorized if you didn’t authorize the connection on your device. A popup should open when you connect a device via adb. Some buggy devices don’t always show this popup immediately. In that case, try adb kill-server; adb start-server, unplug-replug, and if nothing works, use an old adb (v39 or v36).

https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#conflicts-between-adb-versions

(note: if you use the snap version, I suggest you try a non-snap version to use the same adb)

I will suggest trying all solution given above

and then try this if you are using ubuntu then go to home/.android and delete the adbkey then try above steps again like adb kill-server this should work now. note: if there is no .android then turn of show hidden files then it will be visible

If the device is in unauthorized state as listed by adb devices (i.e. if USB debugging is enabled but not allowed on the device), then you can do the following steps.

  1. plug the device: this will open a popup (that you don’t see if your screen is broken)
  2. run scrcpy --otg (see OTG)
  3. press Tab, Enter, Tab, Tab, Enter (this enables “Always allow from this computer” and clicks on OK)

Now your device is authorized. You can run scrcpy.

In my case I’ve used Space instead of Enter. Apart from that, thank you @rom1v and scrcpy for saving my life and 43GB of memories ❤️

Oh, due to USB limitations on Windows, OTG mode does not work when USB debugging is enabled: #3050.

You should try on Linux (even a live USB of the latest Ubuntu is sufficient).

this giving this error INFO: Killing adb daemon (if any)… ERROR: I didn’t find any USB devices when I ran the command. and yet yes remains unauthorized. remembering that my phone’s screen is totally broken over with USB debugging turned on. any more way i can leave from unauthorized to device.

Captura de Tela (14)

bro can you help with a doubt of mine? how can I take my device from unauthorized only with cmd commands. why the screen of my phone this all destroyed I used it by scrcpy most of nowhere stopped mirroring and began to appear this unauthorized always and I can not enable by the phone why the screen is broken as I allow to device only using cmd or other commands that my Windows support ? please any answer or explain whether of the right or not