Sunday, June 10, 2012

keytool -genkey error: Keystore file does not exist(Ubuntu) in Android ?



Below command will generate the KeyStore..........
keytool -list -alias [KEYNAME] -keystore [STORE FILENAME] -storepass [STORE PASSWORD] -keypass [KEY PASSWORD]

shailesh@shailesh-desktop:~$ cd .android/

shailesh@shailesh-desktop:~/.android$ keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
keytool error: java.lang.Exception: Keystore file does not exist: debug.keystore

SOLUTION

Generating a key pair (and a new keystore) has to be done as a separate operation to creating a self-signed certificate for that key.
i.e.
keytool -genkey -alias myKey -keystore store.jks
keytool -selfcert -alias myKey -keystore store.jks


shailesh@shailesh-desktop:~/.android$ keytool -genkey -alias debug -keystore store.jks
Enter keystore password:

Above command will ask for the password and other information and hence the key is generated.


No comments:

Post a Comment