Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 0.4.+ custom debug keystore

Prior to Android Studio 0.4, I was able to set a custom debug keystore via

File -> Project Structure -> Facets -> Compiler Tab

This option has gone at least with Android Studio 0.4.2. Where can I set the custom keystore for being able to share it over different PCs, e.g. via a VCS?

like image 430
Matthias Avatar asked Jan 10 '14 11:01

Matthias


2 Answers

This can be solved by adding signingConfigs to the build.gradle configuration.

android {

    // ...

    signingConfigs {
        debug {
            storeFile file('../debug.keystore')
        }

        /*
        release {
            storeFile file('release.keystore')
            storePassword "mystorepassword"
            keyAlias "mykeyalias"
            keyPassword "mykeypassword"
        }
        */
    }
like image 53
Matthias Avatar answered Oct 19 '22 03:10

Matthias


You can do the same using signingConfigs in build.gradle file and putting certificates in project directory

Step 1. Create a directory inside you module like

  --YourProject
    --your_module
      --KeystoreCertificates
        --myCertificates
        --other_certificates

build.gradle file inside your_module dir

    android {


        signingConfigs {

           myCustomDebug  {

              storeFile file("KeystoreCertificates/myCertificates")
              storePassword "certi_password"
              keyAlias "certi_alias"
              keyPassword "alias_password"      
           }

         }


        buildTypes {

            debug {
               runProguard false
               proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
               signingConfig signingConfigs.myCustomDebug

        }

    }
like image 37
Piyush Agarwal Avatar answered Oct 19 '22 02:10

Piyush Agarwal