Thursday, 2 June 2016

Create keystore and SHA-1 signing-certificate for android app in cordova

No comments
open https://console.developers.google.com

go to credential ---> create credential -->OauthCLientId --> android

enter package name from androidmenifest.xml

for getting SHA-1 signing-certificate

open cmd and type

keytool -genkey -v -keystore C:/CaribeanTaxi/CaribeanTaxi.keystore -alias [CaribeanTaxi] -keyalg RSA -keysize 2048 -validity 10000

here C:/CaribeanTaxi/CaribeanTaxi.keystore is keystore path which ever you pass
RSA is algorithm

now enter password and all fields which it asks for

now open build.json in your cordova project  and add

{
     "android": {
         "release": {
             "keystore": "C:/CaribeanTaxi/CaribeanTaxi.keystore",
             "storePassword": "caribean",
             "alias": "CaribeanTaxi",
             "password" : "caribean",
             "keystoreType": ""
         }
     }
 }

here password is same which asked while creating keystore

no type in cmd

keytool -exportcert -keystore C:\CaribeanTaxi\CaribeanTaxi.keystore -list -v

this will ask you to enter same password 



To Create Release

add new buid.json  in root folder outside of www

build.json


{
     "android": {
         "release": {
              "keystore""C:\\app\\app.keystore",
             "storePassword""app",
             "alias""app",
             "password" : "app",
             "keystoreType"""
         }
     }
 }