2

I'm starting to mess with Android SDK (on Ubuntu GNU/Linux), and am seeing stuff like running the tools/android and its GUI, adb or gradlew for the first time. So, I'm trying to set this up, and in reading stuff around, I see mention of ~/.android/adbkey and ~/.android/adbkey.pub. As far as I understand, these are the automatically generated debug keys - but I cannot tell: are these the same on every computer where the SDK gets installed, or are they different?

So I look into ~/.android, and they are indeed there; and I guess in a moment of madness, I decided to delete them (I guess to see what happens :)). Anyways, I soon regretted it, and I tried to look up online how to regenerate them. Unfortunately, I cannot find any explicit reference saying what command I should run, in order to get these file generated/recreated.

So that is my question - what tools should I run, to re-generate these keys?


EDIT: I tried re-running sdk/tools/android, it doesn't reconstruct the keys. Then I tried deleting the ~/.android folder:

rm -rf ~/.android
sdk/tools/android

... and after re-running sdk/tools/android, the ~/.android folder does get reconstructed, but not the adbkey* files.


Answer from comments (better formatted):

Ah, found it (via linux - Android Debug Bridge (adb) device - no permissions - Stack Overflow); what I did was:

$ sdk/platform-tools/adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
$ sdk/platform-tools/adb devices
List of devices attached 

$ sdk/platform-tools/adb kill-server
$ ls ~/.android/
adbkey  adbkey.pub  androidwin.cfg  avd  cache  repositories.cfg  sites-settings.cf 
  • Ah, found it (via linux - Android Debug Bridge (adb) device - no permissions - Stack Overflow); what I did was: $ sdk/platform-tools/adb start-server * daemon not running. starting it now on port 5037 * * daemon started successfully * $ sdk/platform-tools/adb devices List of devices attached $ sdk/platform-tools/adb kill-server $ ls ~/.android/ adbkey adbkey.pub androidwin.cfg avd cache repositories.cfg sites-settings.cf – tmnaa Jun 7 '14 at 19:01
  • ... Basically, one just has to rerun the adb server, possibly ask for devices list, and close the server; after that the adbkey file are rebuilt. (shame one cannot answer own question before 8hrs expire; this comment would have looked better as an answer) – tmnaa Jun 7 '14 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.