550

Since I reinstalled Eclipse (simply deleted and downloaded it again) I can't debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fine before reinstallation.

Unplug/plug, Uncheck/check "Debug Enabled", adb kill-server/adb start-server, restart phone/computer doesn't work for me. On the device authorize dialog never appears (but I remember that dialog appeared before reinstallation). I have no idea how to force this authorize dialog to display. There is no abd_key.pub file in .android directory. When i try read cpu info DDMS says:

[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.

Any ideas? Is it possible to generate keys manually without confirmation dialog?

USB Connection Via USB

Wireless Connection Via Wi-fi

Alex P.
  • 30,437
  • 17
  • 118
  • 169
Quak
  • 6,923
  • 4
  • 18
  • 22
  • 5
    Random guess, but what if you delete all debug authorizations in settings on the phone. – Chris Stratton Apr 15 '14 at 13:19
  • I did it but nothing happens... – Quak Apr 15 '14 at 13:21
  • USB Drivers reinstalled - still nothing. – Quak Apr 15 '14 at 13:39
  • Worked for me first time +1 – punith Apr 14 '15 at 06:23
  • 8
    1. unplug, 2. goto the developer menu, 3. remove all allowed devices, 4. replug the usb to your pc, 5. on the pop-up on your phone select remember, click allow, done! 6. ? 7. profit! –  Dec 04 '15 at 18:49
  • If you followed all this steps and still don't get a prompt to authorize the RSA fingerprint try deleting $HOME/.android/adbkey as suggested here: http://stackoverflow.com/questions/31638582/android-adb-devices-unauthorized – Romina Liuzzi Aug 03 '16 at 11:19
  • I can't get the "pop-up on your phone requesting permission" to pop up. Yes I did everything in the newb suggestions, like revoke all authorizations, bounce the "USB debugging" button, reseat the cable, etc... – Phlip Apr 02 '22 at 17:19
  • Just restart your device then plug in usb again. – vicky Jun 15 '22 at 11:00

42 Answers42

1394

It's likely that the device is no longer authorized on ADB for whatever reason.

1. Check if authorized:

<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d        unauthorized

2. Revoke USB Debugging on phone

If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).

3. Restart ADB Server:

Then restarted adb server

adb kill-server
adb start-server

4. Reconnect the device

The device will ask if you are agree to connect the computer id. You need to confirm it.

5. Now Check the device

It is now authorized!

adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d        device
Michael G
  • 129
  • 10
Martin
  • 13,980
  • 2
  • 12
  • 3
  • 7
    Step two was not necessary here, but couldn't find that menu either. – Simon Forsberg Feb 06 '15 at 14:02
  • 93
    The device didn't ask (or I didn't see it ask) if to agree to reconnect, but after following the above steps, then turn off and turn back on usb-debugging, it worked. – Jack BeNimble Apr 03 '15 at 20:32
  • When the `List of devices attached` was empty, mysteriously for my 4.3 device, doing these steps actually helped it to show the device. (I also had to turn off the mtp and ptp usb modes I'd enabled when trouble shooting earlier as they would oscillate between debugging and media device modes). – dlamblin Aug 05 '15 at 05:21
  • 3
    Didn't work for me; Android 6.0 Marshmallow has no option "Revoke USB debugging authorization." Note: after killing ADB, I get "This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong"; as well as "error: device unauthorized" etc. – Aaron Campbell Oct 30 '15 at 22:34
  • I did have to plug int it and unplug it a few times to get the authorize dialog on the device. Also toggled usb debugging a few times too – Dave Pile Feb 29 '16 at 23:18
  • 2
    I can't find option "Revoke USB debugging authorization" on Android 4.4.4. Where is it? – JohnyTex Apr 13 '16 at 09:18
  • 1
    Worked great, though I had to make sure 'Stay awake' is selected since if it's not, it ends up killing the connection and going back to 'unauthorized' when the screen goes dark. – Water Jan 09 '17 at 01:00
  • 10
    If your device doesn't prompt for authorization it might be because the account you're running `adb` from doesn't have permission to handle keys. If this happens to you, try it elevated permissions (e.g. `sudo`). – MatrixManAtYrService Aug 27 '17 at 20:54
  • Revoke USB debugging authorization was deprecated and is no longer available. – Aero Wang Sep 07 '17 at 07:45
  • For those who didn't get a prompt on your devices, please run the command with sudo. It works for me. – hellojoshhhy Oct 12 '17 at 02:22
  • I got Settings has stopped on Emulator – Hitesh Sahu Oct 24 '17 at 05:40
  • 1
    helped: adb kill-server, adb start-server – Sergii Dec 12 '18 at 14:02
  • Sometimes this variant is not work. In that case I do all steps and then connect device into another USB-port on my PC – Vladimir Eremeev Feb 12 '19 at 07:35
  • If you don't want to mess with command line actions, open the task manager and kill the background process adb.exe. It's the only step I needed. – Androidcoder May 05 '19 at 13:37
  • Eventually my mobile asked for the permissions (pop up message that I need to approve), this was the key to get 'device' instead of 'unauthorized'. – Melroy van den Berg Aug 31 '21 at 23:43
  • 5
    Turn USB debugging off and On again. Only way it worked for me... – Akintunde May 08 '22 at 05:42
  • I had to turn off and on Developer options instead of "Revoke USB debugging authorization", just as @khamidjon-khamidov pointed out in his answer. (Android 10, Redmi 7A) – Felix Jan 31 '23 at 14:01
  • Depends on your device/Android, BUT the device has to allow the computer connecting FIRST, only then it can enter the "allow debugging layer". On Linux, this means: have your device attached, then go to Nautilus and click the device on the left bar. It will prompt "Allow connecting to the computer." ONLY after that, and with the adb server running, it will prompt for the debugging connection. – isync Aug 13 '23 at 18:11
125

Try forcing ADB to create new keys.

  • On Linux/OSX:

      $ mv ~/.android/adbkey ~/.android/adbkey.old
      $ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
      $ adb kill-server
      $ adb start-server
    
  • On Windows 10 (thank you, Pau Coma Ramirez, Naveen and d4c0d312!):

    • Go to %HOMEPATH%\Android\.android\
    • Look for files called adbkey or adbkey.pub.
    • Delete these files. Or, if you want to be on the safe side, move them to another directory.
    • Repeat the above steps in %USERPROFILE%\.android\
    • Try again

After this I didn't even need to unplug my phone: the authorization prompt was already there.

raveren
  • 17,799
  • 12
  • 70
  • 83
e18r
  • 7,578
  • 4
  • 45
  • 40
98

Ohhh finally I figured it out! After removing Eclipse directory I installed it into another directory.

echo %ANDROID_SDK_HOME%

has displayed wrong path to sdk directory.

  1. set ANDROID_SDK_HOME "E:\adt-bundle-windows-x86_64-20140321\sdk"
  2. unplug device
  3. adb kill-server
  4. adb start-server
  5. plug device

After these steps, I was able to see confirmation dialog with RSA fingerprint on my phone :)

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
Quak
  • 6,923
  • 4
  • 18
  • 22
  • it's not showing debug enabling dialog...any suggestion here! – CoDe Sep 22 '14 at 06:59
  • 1
    Setting the environment variable worked for me, but I had to perform a reboot for it to take effect. – Tim S. Van Haren Dec 10 '14 at 14:54
  • In my case an environment variable of ANDROID_HOME_SDK point to 'E:\android-sdk\SDK Manager.exe' which wrong. so, after I change to 'E:\android-sdk' I try to echo like him said but enviroment seem not to update. so, I restart pc -> unplug usb -> adb kill-server -> adb start-server -> plug usb -> work ! – Jongz Puangput Oct 21 '15 at 09:45
  • I was using adb kill-server and adb start-server that doesn't work but when when unplug device and use these the command it worked thanks! – Yirga Dec 21 '16 at 18:19
  • Steps 2-5 helped me. The only weird thing - step 4 did not work without sudo. I mean, it did start the server, no errors. But authorization popup did not appear on the phone. (And after step 2 I've cleared all stored authorizations on the device, not sure if it was important) – Евгений Савичев Oct 05 '18 at 17:38
57

I run into the same issues with nexus7.

Following worked for fixing this.

  1. Open Developer option in the Settings menu on your device.

  2. Switch off the button on the upper right of the screen.

  3. Delete all debug permission from the list of the menu.

  4. Switch on the button on the upper right of the screen.

now reconnect your device to your PC and everything should be fine.

Sorry for my poor english and some name of the menus(buttons) can be incorrect in your language because mine is Japanese.

Harpreet Singh
  • 2,651
  • 21
  • 31
user3787209
  • 571
  • 4
  • 3
  • 5
    This worked for me. step 3 seemed vague, but for that I "revoked usb debugging authorization." When I connected the device back up (after enabling debugging options and usb debugging again) it prompted me to save the computer's RSA key. Thanks :) – SgtPooki Sep 11 '14 at 18:38
  • This worked for me on a Wiko Lenny. Disconnect device, switch ``Developer`` mode off, revoke debug permissions, turn ``Developer`` options back on, reconnect device, re-enable ``USB debugging``. – user1438038 Jan 02 '15 at 15:50
  • After trying to fix this for a while, `Revoke USB Debugging Authorization` now makes my emulator hard-reset. Quality. – Timmmm Mar 25 '19 at 22:45
47

I had the same problem. It was resolved by setting "USB computer connection" to "Camera (PTP)" instead of "Media Device (MTP)

Tim Boland
  • 1,872
  • 4
  • 23
  • 37
  • 1
    Only way is working for my `ID 1004:631d LG Electronics, Inc. Optimus Android Phone (Camera/PTP Mode)` Thank you! – josejuan Jul 21 '15 at 20:53
  • 1
    this worked for me too.. on redmi note 3 NitrogeOS 7.1.2 – ashishsony Apr 16 '17 at 17:02
  • Did it for me on OnePlus One Lineage 14.1. – Alex Bergsland May 18 '17 at 19:19
  • Worked for me on a Samsung Galaxy S4 Active. – Étienne Nov 06 '18 at 09:46
  • Tried everything, only this solution worked (setting a different USB mode - Transferring Images - in "default USB configuration"). The machine has a rather old motherboard (with an old chipset) and an AMD CPU, so this seem to a driver-related issue. – Javad May 15 '19 at 14:56
  • 1
    Worked on S20+ with Android 11. Set the para to "image transfer". Then I had the prompt on my device in order to authorize it. Thanks ! – toto_tata Jan 05 '21 at 07:57
  • 4
    I connected my Samsung Galaxy S21 5G running Android 11 to my Mac Mini (2018) running macOS 11.6, but my phone wasn't prompting for authorization. I changed "Use USB for" from "Transferring files / Android Auto" to "Transferring images" and that worked – Adam Taylor Oct 13 '21 at 21:50
  • Good answer and often overlooked. It was on share files by default, I put it on only charge and the auth request popped up on the phone. – ThaJay Apr 12 '22 at 11:16
  • where to change this options (Android emulator Pixel4, API30) ? – CodeBy Aug 24 '22 at 09:25
31

I wasted hours on this stupid issue. None of the above solutions worked for me on their own.

I'm running Windows 10. I had an old manual install of the Android SDK as well as Android Studio's SDK. I deleted my manually installed SDK and all my devices stopped working. These were the symptoms:

$ adb usb
error: 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.

as well as

$ adb devices
List of devices attached
id1        unauthorized
id2        unauthorized
id3        unauthorized

To be honest I'm not sure which of these steps got me my Allow USB debugging? prompts back so I listed EVERYTHING for completeness. Goes in order from easiest to hardest. Most people seem to be back on their feet after the first two sections.


Restart ADB

I would perform this after each of the sections below.

adb kill-server
adb usb

Go crazy with developer options

  1. Turn Developer options off and back on
  2. Turn USB debugging off and back on
  3. Revoke USB debugging authorizations. Try this while USB debugging is on and if possible try also when USB debugging is off.

Replug devices

  1. Unplug and replug USB cable into phone.
  2. Switch physical ports on your PC that your USB cable is connected into
  3. Switch physical USB cables you're using to connect your devices

Start rebooting everything

  1. Reboot all your devices and connect again
  2. Reboot your PC
  3. Toggle WIFI on and off

Start deleting things

  1. CAUTION Delete your ~/.android folder. Sometimes this folder can have the wrong permissions which can cause issues. You might want to back this folder up first.
  2. Uninstall all manufacturer specific drivers from add/remove programs. I uninstalled the following (names are not exact)
    • LG United USB Driver
    • HTC Mobile USB Driver
    • OnePlus USB Drivers 1.00
    • Samsung USB Driver
  3. I also uninstalled all emulators and their respective drivers (optional)
    • Nox & related drivers
    • Bluestacks
    • Genymotion

Erase all Android related environment variables.

  1. Delete %ANDROID_HOME% if you have it set
  2. Delete %ANDROID_SDK_HOME% if you have it set

At this point all my devices magically came to life and started displaying the Allow USB debugging? prompts and connecting properly through ADB. If you've made it this far and haven't found a solution, I am truly sorry you're in this predicament. Make sure you've restarted all devices and your dev machine at the end of all of these steps and connect to a fresh USB port using a new cable.

If that still doesn't work try some of these other SO posts on the subject:

Community
  • 1
  • 1
alexgophermix
  • 4,189
  • 5
  • 32
  • 59
  • 8
    None of the other suggestions here worked, but this one got me on the right tracks. The ~/.android directory part is almost right. After a recent Android Studio update for SDK adb stopped working, with exectly these symptoms. In the end I found out that ~/.android/adbkey and ~/.android/adbkey.pub were both 0-sized files, so I've deleted them, restarted adb server, et voila! Got my auth prompt immediatelly. – mkilmanas May 11 '17 at 07:26
  • 3
    Also had joy deleting `~/.android` – Evan Carroll Oct 10 '17 at 05:18
  • 3
    Thanks. Deleting ~/.android solved it for me after having done everything else and staying there for long as well! – Sheila Oct 07 '18 at 06:37
  • @EvanCarroll you just need to delete `~/.android/adbkey` – João Pimentel Ferreira Jun 26 '19 at 20:39
  • Deleting the adbkey file did it for me. After I reset device, pc etc and deleting this; – Kevin Cloet Sep 03 '19 at 12:15
  • Replacing the USB cable did it for me. My symptoms were that "adb devices" lists the status of any device as "authorizing". I have a USB hub with 4 USB-A ports connected to one of the MacBook's USB-C ports. I connect the phone thru that with a USB-A-to-USB-C cable (as well as an external keyboard and mouse). Connecting the phone directly with a USB-C-to-C cable fixed the issue. (Note that the previous setup was fine from macOS Mavericks thru Mojave on past MacBooks, and on High Sierra and Mojave on this one.) – Andy Marchewka Jul 30 '20 at 13:02
30

For me, I firstly unauthorized my device accidentally which I found out later. To revert it back to reauthorise:

  1. Disconnect USB device from laptop/computer
  2. Click 'Revoke USB debugging authorisations' in Developer options.
  3. Disable developer options on top.
  4. re-enable it again.
  5. enable USB debugging
  6. run command 'adb kill-server' on terminal
  7. run command 'adb start-server' on terminal
  8. connect your mobile device to laptop/computer
  9. reauthorize
  10. press like)

Note: if above doesn't work, trying restarting your laptop before connecting again

Khamidjon Khamidov
  • 6,783
  • 6
  • 31
  • 62
18

Steps that worked for me:
1. Disconnect phone from usb cable
2. Revoke USB Debugging on phone
3. Restart the device
4. Reconnect the device

The most important part was rebooting the device. Didn't work without it .

vovahost
  • 34,185
  • 17
  • 113
  • 116
  • 1
    From my experience working with AndroidTV devices I remember them behaving the same as a normal phone so you should try it out. – vovahost Mar 05 '19 at 13:13
17

After having spent over an hour going in rounds swearing at Samsung (mostly), Google, and who not, here are my findings, that finally helped me get the device recognized:

  1. On Device:
    • Set developer mode
    • Allow USB debugging
    • Default USB configuration > Select USB tethering
    • Connect device to PC USB
  2. On PC:
    • Elevated cmd/ps prompt (maybe not mandatory, but that was my drill)
    • adb kill-server (precede with .\ in ps)
    • adb start-server (while device connected) > watch for prompt on device
  3. On device:
    • Always allow connections from this computer > Yes
  4. On PC:
    • adb devices gets the following output:
List of devices attached
278c250cce217ece        device
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
15

For reference, I just encountered much the same issue on Linux and had a hell of a time figuring it out. I eventually determined that I had a ~/.android directory that was root owned (thanks to running adb as root, while flailing around trying to figure out other connection problems). Deleting that root owned ~/.android directory resolved the missing authorisation dialog next time I reconnected the device.

It's possible that simply changing the ownership would also have fixed the problem - I'm guessing it was a simple lack of access to the adb key file stored inside that was the root of the problem. I didn't verify that, though, and I'm not going to deliberately break my hard-won connectivity just so I can check ;-)

himi
  • 151
  • 1
  • 2
13

Recheck 'USB Debug' option in developer options helped me

Alexmelyon
  • 1,168
  • 11
  • 18
12

Had similar issue on osx and Nexus 5 (A6.0.1). I did get the authorization pop-up and confirmed it, despite that Android Studio nor any other IDE could connect to device.

Turned out my Nexus (rooted) was missing key files.

  • Rebooted Android device into recovery
  • Ran code pasted below
  • Rebooted Android device, adb now identifies device

Push key from computer to Android device:

 cd ~/.android && adb push adbkey.pub /data/misc/adb/adb_keys

Solution came from here

Community
  • 1
  • 1
Deko
  • 1,028
  • 2
  • 15
  • 24
  • 1
    THIS is the answer for a device which can't show an ADB authorization dialog (like when having a custom kernel installed) – BamsBamx Feb 04 '20 at 00:50
9

I was getting this error with my Nexus 10. I tried all of the answers I could find, and then I realized I was using a different USB port than usual. I switched to using the port I usually use, which is on the other side of my laptop, and the authorization popped up on my tablet!

GDefender
  • 511
  • 5
  • 10
8

As the message have stated, you need to allow the adb access on your phone.

You need to first connect the phone to your PC with USB cables, then the authorization message will pop out on the screen. Tick remember your choice, then allow it.

IF your device doesnt shows any messages when connected to the PC.Just do this.

Remove /data/misc/adb/adb_key, reboot your phone and try connect again. The message should come up.

ShihabSoft
  • 835
  • 6
  • 15
7

The solution is to copy your file ~/.android/adbkey.pub (on GNU/Linux, or %USERPROFILE%\.android\adbkey.pub on Windows) to Android, and place it as /data/misc/adb/adb_keys. You need root privileges to do that.

You can transfer the file any way you like (or are able to), be it USB, e-mail or a temporary file upload service. In my case, as it was a new Android-x86 installation in a Virtual Machine, no usable web browser, and with network/TCP adb not working, I had to actually type in the 715 characters.

At least it worked.

Marc.2377
  • 7,807
  • 7
  • 51
  • 95
7

If you are on ubuntu, try running the server as root:

sudo adb kill-server

sudo adb start-server

Samson Maosa
  • 472
  • 5
  • 11
7

Simply, turn off developer options from your device and again turn on, attach USB with the device and working system and turn on USB debugging.

gaus
  • 223
  • 4
  • 12
  • This has already been mentioned in other answers. *When answering older questions that already have answers, please make sure you provide either a novel solution or a significantly better explanation than existing answers.* – Eric Aya Oct 12 '21 at 10:34
  • 1
    In my case this worked for me. – Ranjit Vamadevan Nov 28 '21 at 12:52
6

I was tiered with this, I got that permission dialog by turning off wi-fi of my phone.

Sakkeer Hussain
  • 459
  • 6
  • 19
5

I was not getting the RSA fingerprint pop up on my phone.

I had to go into the

  C:\Users\<userName>\.android\adbkey and adbkey.pub 

files, delete those and then do kill and restart of adb server. I had to stop and restart the debugger and connecting as USB in PTP mode.

Because the RSA authorisation key was getting stored in this path, killing and restarting the adb server didn't help.

lakme.1989
  • 163
  • 2
  • 6
5

Disconnect your device from the computer.

Go into developer settings.

Turn off developer settings.

Turn on developer settings.

Enable USB Debugging (and whatever other settings you enabled beforehand)

Reconnect your device to the computer.

Try again.

Worked for me so hope it works for you!

isXander
  • 127
  • 1
  • 7
4

This solved my issue!

  1. run your android simulator
  2. go to setting and enable developer mode
  3. enable from the developer settings usb debugging

at this point you will get popup massage at you emulator to authorise the device and you are good to go :)

Ofir Attal
  • 1,136
  • 10
  • 10
4

You should delete the file: c:\users\_user_name_\.android\adbkey

Jared Forth
  • 1,577
  • 6
  • 17
  • 32
Nash
  • 51
  • 3
2

On some Samsung devices the mode change that can be set by dialing *#0808# doesn't stick without direct reboot. Once rebooted, dial the same string and make sure that you have adb + mdp selected and USB set to AP. After this make sure to reconnect phone and restart ADB server. Also try to avoid USB hubs and virtual machines witch surely complicate matter further. The follow the previously mentioned instructions for clearing authorized devices etc.

not2qubit
  • 14,531
  • 8
  • 95
  • 135
  • Great! Works for Samsung Galaxy S5 Android 5.0 (OTA updated from KitKat). I should also mention that the issue only appeared on Windows 7 desktop. At windows 7 laptop and mini-mac it never asks for authorization! – madlymad Oct 14 '15 at 20:55
2

I had a similar problem. However, it was solved using a different solution. I thought I might share this here as well. Let me describe my problem first.

I had the Android SDK in my ubuntu. The path to the android SDK was not in the environment variable path. I installed adb using a apt-get command and it could not find the sdk home folder and hence, it was showing the unauthorized error and the device was not popping up anything as well. I got stuck here.

Then I uninstalled the adb using apt-get purge which I installed earlier. The Android SDK has the adb program in the platform-tools folder. I just add the path to the environment variable and it worked like a charm.

export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
adb devices
List of devices attached
f7f716d56905    device

Hence the problem was not setting the Android SDK to the environment variable path.

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
2

The same issue started appearing once I changed my development device, it was solved as:

$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203
2

I just had to follow these simple steps:

  • Remove the wire from laptop and phone.
  • Again attached the wire to my phone and laptop
  • Allowed debugging on the device.

And every thing started to work fine.

Bilal Saeed
  • 2,092
  • 8
  • 31
1

Check if you have Samsung Kies installed. That is one possible solution

Cristian Ciupitu
  • 20,270
  • 7
  • 50
  • 76
lantonis
  • 143
  • 14
  • Yup , in my case I wasn't using an of the shelf Android device , so I had to delete any previous adbkey files , and ask the device manufacturer to send me : adbkey and adbkey.pub ....but for regular devices , "Revoke USB Debugging on phone" seems to do the trick – rugby2312 Feb 05 '21 at 07:15
1

I had the same message in two phones:

- Sony Xperia E
- Samsung Galaxy Core 2

both Android 4.4.2, and i solved it with these two steps:

1.- Updating my adb to 1.0.31, downloading the latest version of Android SDK from SDK Manager

You can check your adb version by typing

adb version

2.- Once the phone is plugged in USB Debugging mode, A message appears asking you to authorize this computer for debugging. You have to mark "Always allow this computer", and click on Allow.

Hope it helps.

voghDev
  • 5,641
  • 2
  • 37
  • 41
1

it's not may work for all situations but because i used a long cable my device doesnt connect properly and the message wont pop up change the cable may solve the problem

Pazel1374
  • 218
  • 3
  • 14
1

I just try adb kill-server, it works for me:

PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186        unauthorized
PS C:\Users\languoguang> adb shell
error: 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.

kill and start adb server:

PS C:\Users\languoguang> adb kill-server
PS C:\Users\languoguang> adb start-server
* daemon not running; starting now at tcp:12345
* daemon started successfully
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186        device
Languoguang
  • 2,166
  • 2
  • 10
  • 15
1

Here's what I did that that brought the authorization prompt and made my device appear. I used a Samsung Galaxy s7 edge.

  1. Enable developer mode and USB debugging on your device.

  2. Revoke the USB debugging authorization

  3. Plug your phone to computer via USB.

  4. Drag notification panel and select "Software Installation" as shown in the image below

    image

  5. This will begin installing USB driver and the prompt for USB debugging authorization will show.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Ibrahimcodes
  • 45
  • 1
  • 7
1

"Device Unauthorized" when trying to screen mirror Huawei

I was redirected to this question from scrcpy's FAQ coverage of "Device Unauthorized" messages when trying to screen mirror an aging Huawei Elite S6 mobile phone to a Windows 10 PC.

With USB debugging enabled on the phone, no popup to authorize debugging appeared and strcpy output these errors on the terminal:

ERROR: Device is unauthorized:
ERROR:     -->   (usb)      AKTBBCB731702690      unauthorized
ERROR: A popup should open on the device to request authorization.
ERROR: Check the FAQ: <https://github.com/Genymobile/scrcpy/blob/master/FAQ.md>
ERROR: Server connection failed

The solution mostly relates to non-standard Huawei modifications to Android:

  1. Connect the phone to the PC with a USB cable.

  2. Drag down the notifications list from the top of the screen on the phone.

  3. An icon titled "USB Connected" should appear in the list

  4. Press "Photos" amongst the modes presented.

    This answer suggested selecting "Camera" as the connection type. Although Huawei doesn't use the same wording or menu structure, choosing "Photos" solved issues that

    • the "Files" option doesn't support adb authentication,
    • the "USB drive" option (which appeared to work initially) prevents or stops phone apps accessing files on the sd card if this connection option is chosen.
  5. Enable USB debugging if a popup appears.

Rerunning scrcpy at this stage worked as expected, with working mouse and PC keyboard input to apps on the phone. No reboots of the phone or PC should be needed during setup - check the tips below if things go wrong.

scrcpy Tips

  • Check "Stay Awake" under developer options in settings to prevent the screen being turned off while mirroring the phone, and turn it off again when done mirroring. Both can be performed from the PC.
  • Close the scrcpy GUI window to kill the adb process on Windows automatically: don't just close or abort the terminal window running scrcpy.exe.
traktor
  • 17,588
  • 4
  • 32
  • 53
1

You need to enable USB Debugging from Settings

Then if still the issue persists then run the following command

adb kill-server adb reverse tcp:8081 tcp:8081

Also try removing the cable and plug it again.

Ali Abbas
  • 540
  • 4
  • 10
0

This is error because your window version haven't driver for usb 3.0 to receiver authenticate permission from phone. I spent 5 day with this bug. Now, install 58964_Intel(R)_USB_3.0 driver. And continue with awesome code!

i use this link to download driver

cuasodayleo
  • 466
  • 5
  • 16
0

adb usb worked for me This restarts the adb daemon listening on the USB port The command returned:

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

. But the prompt for the RSA key showed up on the phone straight away. Once I approved, everything started working as expected

Bobkatt
  • 65
  • 4
0

After installing Android studio, I had incorrect permissions on the folder "~/.android"(access for reading and writing only for root). So I changed it and ran project from Android studio(device still was marked as "unauthorized").

Android studio showed an error "Error installing apk", but in the folder "~/.android" were created files "adbkey", "adbkey.pub", "debug.keystore".

After that I restarted adb (ran commands adb kill-server and adb start-server) and authorization dialog appeared on my device.

Hopefully someone will approach this solution.

0

What I've done to solve the issue was to disconnect and reconnect the usb cable to the USB port again (done with another port on my machine).

Then I have chose to charge and that's it. The mobile device asked me to grant access for the machine, I agreed and that's solved the issue.

When running adb devices, I saw the device in the list.

(Done in Windows 10 home).

osherdo
  • 558
  • 1
  • 7
  • 14
0

I was stuck on this for quite some time, and I was able to side-step the issue completely by copying the adbkey from a computer that my phone would connect to.

lbenedetto
  • 2,022
  • 1
  • 21
  • 39
0

I'm using an older Huawei phone. When I plug in to my Debian Stretch instance I get the USB computer connection popup. If this is set to MTP, PTP or "Connect to PC software" I found that "adb devices" will fail. However, if I set the connection option to:

Mount SD Card

I then could run "adb devices" and status changed from unauthorized to device.

Also I turned on:

USB debugging

Eamonn Kenny
  • 1,926
  • 18
  • 20
0

Not sure if someone encountered the same situation like me where I had plugged my phone to my laptop and trying to run the emulator. That's the reason I was getting this error. If that is the case then unplug your phone and try

Sandeep Amarnath
  • 5,463
  • 3
  • 33
  • 43
-1

Linux-Ubuntu-14.04
I read all the answer for this post, nothing worked for me :(
This may be because I am not using normal end User device, working on corporate device!

Thing worked for me is:
Get VID,PID for your device from lsusb and update 51-android.rules (https://source.android.com/source/initializing.html#configuring-usb-access)
Ensure adb_usb.ini is also updated with same VID, PID

Bhavana Vadodariya
  • 2,287
  • 1
  • 19
  • 26
-4

I tried many ways to solve this problem, this one works for me.

Install SnapPea on your PC. SnapPea

Plug your phone in USB Debugging mode and open SnapPea, a authorization dialog will show on your phone. The Dialog shows on the phone

Hope it helps.

Sanster
  • 1
  • 2