After 10 hours spent, it seems that I need to remove /data/misc/adb/adb_key file and restart the phone. But how can I do it if phone is not rooted and adb has no access?

It's a not rooted HTC One M7 Att. I've tried reinstalling drivers many times and reinstalling sdk. I plugged and unplugged usb, changed ports, turned on and off debugging. Nothing helps and rsa dialog doesn't come up. I've also deleted adbkey files in .Android folder on Windows.

I've connected another HTC One and it worked smoothly. So, problem in the phone.


1 Answer 1


It looks like you know how this works, but for anyone who may not, normally /data/misc/adb/adb_key contains the public keys of all the computers that have adb access to your device, which on your computer is located somewhere like ~/.android/adbkey.pub. If you did have root, you could just use su from the Terminal app, then create the file (say by copying or appending the adbkey.pub file from the /sdcard/ to /data/misc/adb/adb_key).

Without root, it's more challenging. As you note, the way it's supposed to happen is that connecting a device that's never been seen before will result in you being prompted to accept the key from the RSA dialog on the device. But if THAT'S not happening, I suspect that something is wrong with the ADB connection itself. Are you able to verify that adb is working with another device? The command adb devices issued from your computer can tell if your computer sees the device. On Linux devices lsusb will also show whether the device is recognized as connected to usb. Is your computer able to recognize other devices? You say that you've tried re-running adb-- for anyone who may be reading this, doing an adb kill-server followed by an adb start-server is one way to do this.

If you don't want to root your device, you may consider installing a custom recovery instead such as TWRP2, which will allow you to boot into recovery mode as root temporarily to make the change without having to actually touch the /system partition directly. When you're done putting your key into place, you can always re-flash the original recovery and should be good-as-new. Looks like on the HTC One you can use fastboot to flash to the correct partition via the command: fastboot flash recovery recoveryfilename.img. Fastboot is part of the SDK, and it's in the /platform-tools directory. You may need to run it with root privileges.

  • Thank for the input. ADB connection works just fine with another identical phone using same cable and it brings up the dialog. Both phones are brand new.. I couldn't root or install custom recovery, because fastboot was not unlocked yet, if I understand how it works correctly. I should have done original recovery, but haven't thought about it lol. I ended up using my friend's mac and dialog came up. I have no clue what's the reason, but my win works with other phone. And that phone works on other computer. Must be something with adbkey.. but I couldn't figure it out.
    – James S.
    Feb 5, 2015 at 3:04
  • Hmm. That is strange... maybe your RSA key had been cached as not accepted or something. Anyway, glad you got it working :)
    – fattire
    Feb 6, 2015 at 1:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .