Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between 'debug.keystore' and 'release.keystore' in Android?

Recently, I was working with Android Maps V2. I came across debug.keystore and release.keystore. What is the difference between them? Why do we have to use both?

like image 972
Anil kumar Avatar asked Feb 19 '14 12:02

Anil kumar


People also ask

What is a debug keystore?

A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google. To create a debug keystore, use: $ keytool -genkey -v -keystore debug.

Where is the Android debug keystore?

The default keystore file: debug. keystore is present in the folder . android which is usually located in the default home folder of your operating system of the user who installed that Android SDK.

Can I use same keystore for two apps?

So yes, you can use the same keystore to sign multiple apks, without a problem. You can also use the same alias (each alias is a certificate) to sign multiple apks, and it will work.

What is the Android debug keystore password?

Usually the debug. keystore password is just "android". You can delete it and Eclipse will automatically generate a new one, as described here.


1 Answers

The Android build process signs your application differently depending on which build mode you use to build your application.

There are two build modes: debug mode and release mode.

You use debug mode when you are developing and testing your application.

You use release mode when you want to build a release version of your application that you can distribute directly to users or publish on an application marketplace such as Google Play.

When you build in debug mode the Android SDK build tools use the Keytool utility (included in the JDK) to create a debug key. Because the SDK build tools created the debug key, they know the debug key's alias and password. Each time you compile your application in debug mode, the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to sign your application's .apk file. Because the alias and password are known to the SDK build tools, the tools don't need to prompt you for the debug key's alias and password each time you compile.

When you build in release mode you use your own private key to sign your application. If you don't have a private key, you can use the Keytool utility to create one for you. When you compile your application in release mode, the build tools use your private key along with the Jarsigner utility to sign your application's .apk file. Because the certificate and private key you use are your own, you must provide the password for the keystore and key alias.

The debug signing process happens automatically when you run or debug your application using Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build script with the debug option. You can automate the release signing process by using the Eclipse Export Wizard or by modifying the Ant build script and building with the release option.

EDIT

For signing android app with android studio see here

http://developer.android.com/tools/publishing/app-signing.html#releasemode

like image 193
Hardik Avatar answered Oct 09 '22 02:10

Hardik