How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse)

On the Mac, I found the keystore file path, password, key alias and key password in an earlier log report before I updated Android Studio.

I launched the Console utility and scrolled down to ~/Library/Logs -> AndroidStudioBeta ->idea.log.1 (or any old log number)

Then I searched for “android.injected.signing.store” and found this from an earlier date:

-Pandroid.injected.signing.store.file=/Users/myuserid/AndroidStudioProjects/keystore/keystore.jks, 
-Pandroid.injected.signing.store.password=mystorepassword, 
-Pandroid.injected.signing.key.alias=myandroidkey, 
-Pandroid.injected.signing.key.password=mykeypassword,

On Windows

you can find your lost key password in below path

Project\.gradle\2.14.1\taskArtifacts\taskArtifacts.bin or ..taskHistory\taskHistory.bin

Here is the image for path view in folder structure

open the file using appropriate tools e.g. NotePad++ and search with the part of the password that you remember. You will find it definitely. Else, try searching with this string "signingConfig.storePassword".

Note: I have experienced the same and i am able to find it. In case if you didn't find may be you cleared all the cache and temp files.


I finally could figure the issue out.

To get the Key Alias: I copied the keytool.exe and my keystore file into C:\Program Files\Java\jdk1.7.0_71\bin folder. Then from command prompt I wrote: keytool -list -v -keystore <name>.keystore It will also ask for keystore password then. Then it will show you the key alias and Certificate fingerprints and other info.

Then I again tried to Generate Signed Apk for the project, I provided keystore, keystore password, key alias and provided the same password. Then it asks for master password, I tried with the same and it failed. With the reset option I reset the master password here.


how to retrieve keystore password

You cannot retrieve the password. If you forgot it, you are doomed.

how to retrieve key alias

$ keytool -list -v -keystore <store>

But you need keystore password for this first.

EDIT

What I don't remember is the 'Key Password'

No password can be restored. If you forgot key password for good then you are doomed too and there's no other way than trying harder to recall it. There's no password reset thing nor anything like that.

Be aware that if you forgot your password for good then you will issue no further updates to your app (docs):

Warning: Keep your keystore and private key in a safe and secure place, and ensure that you have secure backups of them. If you publish an app to Google Play and then lose the key with which you signed your app, you will not be able to publish any updates to your app, since you must always sign all versions of your app with the same key.