Sample Header Ad - 728x90

How to regenerate/create adbkey and adbkey.pub from the command line?

7 votes
1 answer
39363 views
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. 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. So that is my question - what tools should I run, to re-generate these keys?
Asked by tmnaa (71 rep)
Jun 7, 2014, 06:40 PM
Last activity: May 7, 2025, 02:21 AM