0

I want to sign my apk with my keystore file in debug build also ,i have created a build.json file with following info

{
"android": {
    "debug": {
        "keystore": "..//my.keystore",
        "alias": "alias",
        "password": "password",
        "storePassword": "password"
    },
    "release": {
        "keystore": "..//my.keystore",
        "alias": "alias",
        "password": "password",
        "storePassword": "password"
    }
}
}

when i build the apk with command ionic cordova build android --debug --buildconfig it still sign the apk with default key not mine for ionic cordova build android --release --buildconfig it is fine it is signing with my key i have verified in signing-config.json i am following this documentation https://cordova.apache.org/docs/en/latest/guide/platforms/android/#signing-an-app Please help enter image description here

Kashif ali
  • 23
  • 6
  • i think what you're asking is related [here](https://stackoverflow.com/questions/26449512/how-to-create-a-signed-apk-file-using-cordova-command-line-interface) – Ali Mhanna Mar 20 '20 at 11:43

1 Answers1

0

I usually do that using Android Studio instead of using the Cordova tools. Maybe that's a valid way to do it for you.

Durzan
  • 53
  • 1
  • 6
  • can you explain how to do with android studio? – Kashif ali Mar 19 '20 at 12:21
  • Open with Android Studio the platforms/android directory. Open the Project Structure (Strg + Alt + Shift + S). Navigate to Module and choose app. Click on the tab Signing Configs, add a new config and fill the input fields. Then you navigate to Build Variants and choose there app, too. Under Build Types -> debug fill your new created signing config into the the field Signing Config. – Durzan Mar 19 '20 at 12:26
  • Still android studio signed the apk with default debug key – Kashif ali Mar 19 '20 at 12:57
  • Problem Solved i just need to move the newly buildTypes { debug { signingConfig signingConfigs.Zand } add code after cordova setting its signing config to overrirde Thanks durzan – Kashif ali Mar 19 '20 at 15:18