Android Studio 0.4.+ custom debug keystore

前端 未结 2 2031
你的背包
你的背包 2021-01-02 09:28

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

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

Thi

相关标签:
2条回答
  • 2021-01-02 09:50

    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"
            }
            */
        }
    
    0 讨论(0)
  • 2021-01-02 10:17

    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
    
            }
    
        }
    
    0 讨论(0)
提交回复
热议问题