Srdjan Jovanovic
Srdjan Jovanovic

Reputation: 11

Cordova buildconfig.json keystore path

How can I set Cordova buildconfig.json global path for keystore different than then the relative path where I've stored buildconfig.json. Example:

  1. I stored buildconfig.json in /home/user/test-app/build/sign

  2. A part of buildconfig.json in which I've set a path to the custom keystore ...

    "android": { "debug": { "keystore": "/home/user/keystores/test-release.keystore",

    ...

  3. cordova build android --buildConfig=/home/user/test-app/build/sign/buildconfig.json

Gradle shows an error, bad location of keystore /home/user/test-app/build/sign/home/user/keystores/test-release.keystore

Upvotes: 1

Views: 3115

Answers (1)

Suhail Kawsara
Suhail Kawsara

Reputation: 515

In order to generate signed apk’s, we use a build.json config file that sits in the root of the project. Our build.json file looks something like this:

{
"ios": {
    "debug": {
        "codeSignIdentity": "iPhone Distribution",
        "provisioningProfile": "xxxxxxx-xxxxx-xxx-xxxx-xxxxx",
        "developmentTeam": "xxxxxx",
        "packageType": "ad-hoc",
        "iCloudContainerEnvironment": "Development",
        "buildFlag": [
            "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
        ]
    },
    "release": {
        "codeSignIdentity": "iPhone Distribution",
        "provisioningProfile": "xxxxxxx-xxxxx-xxx-xxxx-xxxxx",
        "developmentTeam": "xxxxxxx",
        "packageType": "app-store",
        "iCloudContainerEnvironment": "Production",
        "buildFlag": [
            "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
        ]
    }
},
"android": {
    "debug": {
        "keystore": "../build-config/android/xxxx.keystore",
        "storePassword": "********",
        "alias": "xxxxxx",
        "password": "********",
        "keystoreType": ""
    },
    "release": {
        "keystore": "../build-config/android/xxxxx.keystore",
        "storePassword": "********",
        "alias": "xxxxxx",
        "password": "******",
        "keystoreType": ""
    },
    "device": {
        "keystore": "../build-config/android/xxxxx.keystore",
        "storePassword": "*******",
        "alias": "xxxxxx",
        "password": "*******",
        "keystoreType": ""
    },
    "emulator": {
        "keystore": "../build-config/android/xxxx.keystore",
        "storePassword": "*******",
        "alias": "xxxxxx",
        "password": "*******",
        "keystoreType": ""
    }
 }
}

I found it here.

Upvotes: 4

Related Questions