How can I specify location of debug keystore for Android ant debug builds?

前端 未结 7 1191
北荒
北荒 2020-12-01 05:36

Is it possible to specify the location of a self created debug keystore when creating debug .apk\'s (-debug.apk) with ant

7条回答
  •  無奈伤痛
    2020-12-01 05:57

    You can remove the signature of the final apk and sign it again. It is just a debug build so the zipalign can be avoided (at least I have no problems in my build).

    Copy your keystore to a file debug.keystore in the project and add the following in ant.properties

    debug.key.store.password=android
    debug.key.alias.password=android
    debug.key.store=../debug.keystore
    debug.key.alias=androiddebugkey
    

    And add the following in your build.xml

    
        
        
        
        
        
        
        
         
    
        Signing final DEBUG apk with a common signature...
            signapk
                input="${out.final.file}"
                output="${out.packaged.file}"
                keystore="${debug.key.store}"
                storepass="${debug.key.store.password}"
                alias="${debug.key.alias}"
                keypass="${debug.key.alias.password}"
        
    
        
    
        
        
    
    
    

提交回复
热议问题