Does Android Studio sign debug builds? If so, where is the keystore it uses to do it?
-
1It does sign anyway because only signed builds can be installed. – Alexander Kulyakhtin May 18 '13 at 09:24
-
3I think this is a valid programming question. It directly relates to the toolchain used when developing Android apps. – Austyn Mahoney Aug 02 '13 at 21:28
-
Duplicate of https://stackoverflow.com/questions/16965058/where-is-debug-keystore-in-android-studio/17992232#17992232 – Prachi Nov 22 '18 at 06:44
-
@Prachi how can this be a duplicate of a question asked more than 3 years later? Maybe it's the other one a duplicate of this. – fasteque Nov 22 '18 at 06:50
-
See also https://stackoverflow.com/questions/12456491/i-dont-remember-my-android-debug-keystore-password – caw Apr 19 '19 at 22:08
7 Answers
It is at the same location: ~/.android/debug.keystore

- 80,996
- 26
- 120
- 129

- 1,805
- 1
- 12
- 4
-
Thanks, looking at the dates of files I thought it created/used something else. – fasteque May 18 '13 at 10:48
-
5
-
14
-
6This is the windows version of the keytool command: keytool -exportcert -alias androiddebugkey -keystore C:\Users\
\.android\debug.keystore -list -v – Simon Dec 16 '14 at 09:49 -
12The default password is "android" and key alias is "androiddebugkey". – naXa stands with Ukraine Oct 08 '16 at 00:48
-
1
-
For windows versions, you can make your project compatible among multiple users by editing the signing configs section in the build.gradle file, and changing storeFile as follows: `storeFile file("$System.env.USERPROFILE" + '/.android/debug.keystore')` – Tjaart Jun 16 '17 at 09:29
If you use Windows, probably the location is like this:
C:\User\YourUser\.android\debug.keystore

- 4,267
- 3
- 31
- 29
You can specify your own debug keystore if you wish. This solution also gives you the ability to store your keys outside of the project directory as well as enjoy automation in the signing process. Yes you can go to File -> Project Structure
and assign signing keystores and passwords in the Signing
tab but that will put plaintext entries into your gradle.build file which means your secrets might be disclosed (especially in repository commits). With this solution you get the control of using your own keystore and the magic of automation during debug and release builds.
1) Create a gradle.properties (if you don't already have one).
The location for this file depends on your OS:
/home/<username>/.gradle/ (Linux)
/Users/<username>/.gradle/ (Mac)
C:\Users\<username>\.gradle (Windows)
2) Add an entry pointing to yourprojectname.properties
file.
(example for Windows)
yourprojectname.properties=c:\\Users\\<username>\\signing\\yourprojectname.properties
3) Create yourprojectname.properties
file in the location you specified in Step 2 with the following information:
keystore=C:\\path\\to\\keystore\\yourapps.keystore
keystore.password=your_secret_password
4) Modify your gradle.build
file to point to yourprojectname.properties
file to use the variables.
if(project.hasProperty("yourprojectname.properties")
&& new File(project.property("yourprojectname.properties")).exists()) {
Properties props = new Properties()
props.load(new FileInputStream(file(project.property("yourprojectname.properties"))))
android {
signingConfigs {
release {
keyAlias 'release'
keyPassword props['keystore.password']
storeFile file(props['keystore'])
storePassword props['keystore.password']
}
debug {
keyAlias 'debug'
keyPassword props['keystore.password']
storeFile file(props['keystore'])
storePassword props['keystore.password']
}
}
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "your.project.app"
minSdkVersion 16
targetSdkVersion 17
}
buildTypes {
release {
}
}
}
}
dependencies {
...
}
5) Enjoy! Now all of your keys will be outside of the root of the directory and yet you still have the joys of automation for each build.
If you get an error in your gradle.build file about the "props" variable it's because you are not executing the "android {}" block inside the very first if
condition where the props
variable gets assigned so just move the entire android{ ... } section into the condition in which the props variable is assigned then try again.
I pieced these steps together from the information found here and here.

- 2,932
- 2
- 20
- 35
-
2
-
-
Thanks, this is a great way of keeping production passwords outside source control (so they aren't available to all devs)! – sham Jul 27 '16 at 14:26
Android Studio debug.keystore file path depend on environment variable ANDROID_SDK_HOME.
If ANDROID_SDK_HOME defined, then file placed in SDK's subfolder named .android .
When not defined, then keystore placed at user home path in same subfolder:
- %HOMEPATH%\.android\ on Windows
- $HOME/.android/ on Linux

- 18,640
- 7
- 62
- 66
-
1Could you please elaborate more your answer adding a little more description about the solution you provide? – abarisone Jun 18 '15 at 07:33
-
why 87 people think it's in ~/.android/debug.keystore,they all don't have a environment variable named "ANDROID_SDK_HOME"??? – IloveIniesta Sep 02 '15 at 09:56
-
-
Here's the docs explaining possible variables https://developer.android.com/studio/command-line/variables According to it, ANDROID_SDK_HOME is for older tools and ANDROID_USER_HOME use used now (as of Sept 2022). – user1053510 Sep 27 '22 at 07:55
Here's how i finally created the ~/.android/debug.keystore file.
First some background. I got a new travel laptop. Installed Android Studio. Cloned my android project from git hub. The project would not run. Finally figured out that the debug.keystore was not created ... and i could not figure out how to get Android Studio to create it.
Finally, i created a new blank project ... and that created the debug.keystore!
Hope this helps other who have this problem.

- 820
- 2
- 11
- 18
If you use Windows, you will found it follow this: File-->Project Structure-->Facets
chose your Android project and in the "Facet 'Android'" window click TAB "Packaging",you will found what you want

- 19
- 1