28

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?

user2002077
  • 595
  • 1
  • 6
  • 17
  • 1
    I think you can get a PC (at least one running Linux) to emulate a bluetooth mouse, so you could see if that will work. Did the program you found that did not work emulate a keyboard? Since you just did a factory install anyway, you could a fastboot oem unlock and install a custom recovery with rooted adb and use that to poke around in the main partition. – Chris Stratton May 12 '15 at 02:10
  • Yes anything bluetooth or wireless I tried did work on the tablet but as soon as the dialog pops up it no longer works so I couldn't click it - probably for security. I have just rooted the device again. I don't really want to do a custom ROM. There is away to do the keys manually like aorlando said but I'm not sure how to do it. – user2002077 May 12 '15 at 11:12

5 Answers5

28

If you are using macOS (or any Linux distro):

  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.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
kiradotee
  • 1,205
  • 12
  • 20
  • This also works for Ubuntu/Arch Linux – TAAPSogeking Jun 09 '17 at 00:45
  • 6
    it doesn't work for me! 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. I think they doesn't think that user could try to enable it with broken screen – Daniel Jose Padilla Peña Dec 07 '18 at 20:29
  • 1
    Didn't work for me either - same error message as Daniel Jose Padilla Pena. – Michal J Figurski Sep 12 '19 at 13:52
  • 2
    `adb push` does not work if debug grant popup is not accepted! – JRichardsz Jul 05 '20 at 01:13
  • @JRichardsz wonder if this is a recent change with a newer Android version? Certainly worked for me 4 years ago when I needed it. – kiradotee Jan 11 '21 at 14:44
  • 1
    How do you reboot into recovery mode without seeing the screen? – Marcel Aug 31 '22 at 01:20
  • "without seeing the screen" hmm.. this is the answer I seek. Maybe by sheer luck! But being an android dev, I have lost hopes since grant popup is security before you can access a device. – sud007 Jan 14 '23 at 12:33
5

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

  • 4
    how do you install it on broken device? – Daniel Jose Padilla Peña Dec 07 '18 at 16:55
  • @DanielJosePadillaPeña, I know this is old, but in case some else needs it: You can install software from https://play.google.com/ to your device, as long as You're logged-in on the browser and have that account linked to your device. – Skaparate Feb 15 '19 at 02:43
  • @Skaparate. OK, I was able to install it (at least Play Store says so). How do I access it from a PC? – Michal J Figurski Sep 12 '19 at 13:54
  • @MichalJ.Figurski you need to install teamviewer on your computer and link both devices to the same account, which should enable you to remote control the phone. If you have never installed teamviewer before on your phone, then it will not work, as You would need to login to teamviewer on the phone. Your best bet in this case might be to buy a HDMI adapter to connect the phone to a screen. – Skaparate Sep 13 '19 at 14:11
2

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.

Edric
  • 24,639
  • 13
  • 81
  • 91
NatalyaKst
  • 315
  • 3
  • 6
1

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

aorlando
  • 668
  • 5
  • 21
1

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.

Bill K
  • 35
  • 1
  • 2
    OK, I've installed the teamviewer via Play Store website. Now what? How do I connect to it? – Michal J Figurski Sep 12 '19 at 13:56
  • 17
    the question says broken touch screen. so how can we install teamviewer on the phone – A Khudairy May 07 '20 at 11:53
  • You can install it from any other device via the web version of Play Store by logging in to the same Google account that your phone is using. Just click install and choose your device. – Simp Slayer Oct 25 '20 at 00:17