How to authorize and accept ADB RSA key with broke

2020-05-26 16:43发布

问题:

My Nexus 7 2012 has a broken touch screen so I use an OTG mouse with it. I recently had to do a factory reinstall so am running v5.1 lollipop. The problem is I now have to re authorize adb with my computer so I can do work on it but cannot accept the RSA key when the dialog pops up because my touch screen is broken.

I cannot use my otg mouse because the Nexus 7 is connected to the computer, I have tried a bluetooth remote android device app which fails to work when the dialog shows, I have tried using another remote android app over wifi, I have tried using my computer keyboard via telnet but fails to work when the dialog appears. I don't have a bluetooth mouse but don't even know if that would work.

Does anyone have any suggestions how I can accept the ADB RSA key dialogue to authorize adb with my computer without the use of a touch screen. Thanks?

回答1:

If you are using OS X*:

  1. Reboot your phone into recovery mode.
  2. Connect it to your computer.
  3. Open the terminal and type:

    cd ~/.android
    adb push adbkey.pub /data/misc/adb/adb_keys
    
  4. All done! Just adb shell reboot and feel the power!

*For Windows 10, .android directory is located in your the base of your C:\User\user_name directory.



回答2:

This is actually very simple (although a little bit late..). You can download the teamviewer host from the playstore and teamviewer into your phone from your computer. Once the adb authorization prompt appears just accept it through teamviewer and you are set. Remember to check "Remember this computer" so you don't have to do this every time. Keep in mind that to control your device through teamviewer you need to add it to an account.



回答3:

Using OTG and teamviewer help me control a broken touch screen android.



回答4:

you can add the RSA key copying it from computer and adding the line to /data/misc/adb/adb_keys, but only with rooted device



回答5:

If screen is broken and you can't enable ADB by clicking on a confirmation dialog with the RSA key, you can run TWRP Recovery and copy a file from this mode:

adb push adbkey.pub /data/misc/adb/

But it will work only on a rooted device.



回答6:

I got it working. I rooted the device. Downloaded wifi adb app which requires root and connected to adb over wireless. This allowed me to use the micro usb at the same time and click accept when the RSA dialogue popped up.
Thank you for your comments.