Search code examples
androidandroid-studioauthorizationadbgalaxy

Android - Authorise computer on phone


I currently own a Samsung Galaxy S7 and I'm using it to test an app I'm developing. Yesterday, I connected my phone to my computer via. the USB 3.0 port. A pop-up screen came up asking if I wanted to authorise, and I pressed yes. I then ran the app via. Android Studio and it installed successfully on my phone and I could test it. I then made some changes to the app's code and attempted to debug again, however an error popped up in the app and as soon as that happened, the phone no longer was 'authorised'. I switched USB connections to Photo only and it worked (did not work when I connected my phone to my USB 2.0 port). However, another error occurred (due to my code) and the phone became unauthorised again. Now I have no more front USB ports and my phone isn't being authorised. I've tried the following, but none of them have brought up the prompt asking me if I want to authorise the computer again:

  • Ran adb kill-server and adb start-server
  • Unplugged and re-plugged the phone multiple times
  • Turned off and on Developer mode
  • Turned off and on USB debugging
  • Revoked authorised computers in the Developer options
  • Rebooted the phone multiple times
  • Switched USB connection types
  • Deleted keys in .android folder
  • Updated android SDK

It's really frustrating me, is there anything else I can do to try and make my phone authorise my computer? Thanks in advance.

Edit: Temporarily, I've gotten it to work by typing 'android update adb'. However, I'm almost certain this is temporary as it always seems to stop working after an hour.


Solution

  • Try these following steps:

    1) Killing and starting adb server at adb cmd.

    2) Switching Usb Debugging on and Off and ...

    This is What WORKED with me.

    Step 1:Remove Connection with Device and Close Eclipse

    Step 2:Navigate to C:/Users/User_name/.android/

    Step 3:You Will Find adb_key

    Step 4:Just delete it.

    Step 5.Connect again and System will ask you Again.

    Step 6.Ask Device to remember RSA Key when it Prompts. I think its done.

    If you Face The Same Problem after couple of days, just disable and enable USB debugging

    otherwise (if on windows)

    Right Click on my computer->mange->Device manager->Samsung Android Phone->Samsung android ADB interface->uninstall
    

    then un-plug device and plug it again and tick always allow