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

MSIslam picture MSIslam · Jan 19, 2015 · Viewed 179.6k times · Source

I have an android app currently published in Google Play which I update periodically. I follow the following process to sign the app before a new push:

Press right-mouse on the project, the 'Android tools' -> export signed application package Provide keystore password Sign your app Upload the apk file into Google Play Developer Console

Recently I have imported the project from Eclipse to Android Studio and continued working on Android Studio. Now I am planning to push a fix in the app. I have figured that I have this option to sign apk in android studio

Build -> Generate Signed apk ->enter image description here

As per my understanding, for my android app I have to use the same key store and key store password which I used earlier to push updates into Google Play. Also here it's asking for Key Alias and Key Password. I don't remember the Key Alias and Key password(number 4 input in the image) while signing apk in Eclipse. Any suggestion what can I do now? If I already know my keystore and keystore password, is there an way to retrieve the key alias and alias key password?

Update: Now I can retrieve my key alias through keytool -list -v -keystore name.keystore command

Answer

gkemp picture gkemp · Jul 5, 2015

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.