Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 4.2.2 USB debugging "Always allow from this computer" option result in target unknown for device?

I am having problem connecting my 4.2.2 android device with PC after I select "Always allow from this computer".

I have selected "Always allow from this computer" in 4.2.2 USB debugging and it works fine the first time but when I tried other time my devices always appear offline. I have tried with another device that is also 4.2.2 and the USB debugging popup and when I click ok (without selecting "Always allow from this computer") with device list became online.

I have tried the following method and it didn't work

  • adb kill-server/ adb start-server/ and adb devices
  • install new eclipse, android SDK, and ADT
  • Plug and unplug my device thousand times
  • try repeating steps from this link

Are there anyway to get rid of "Always allow from this computer" once I selected?

like image 523
GoalGinger Avatar asked Feb 24 '13 15:02

GoalGinger


1 Answers

As described in this issue, this can happen if you run adb for the first time as root. It creates a key file on your computer owned by the root user, so your normal user account can't read or overwrite it.

To check if this is the case:

$ ls -l ~/.android/adbkey
-rw------- 1 root root 1708 Nov 13  2012 .android/adbkey
             ^ notice root here

To fix it:

$ sudo chown $USER: ~/.android/adbkey
$ ls -l ~/.android/adbkey
$ -rw------- 1 thomas thomas 1708 Nov 13  2012 /home/thomas/.android/adbkey
               ^ now shows your username and primary group

Finally, restart the adb server:

$ adb kill-server
$ adb start-server
like image 167
Thomas Avatar answered Nov 09 '22 23:11

Thomas