How to create a signed and unsigned working .apk using cordova?

前端 未结 2 1107
夕颜
夕颜 2021-01-16 09:11

I am trying to create an .apk file for my mobile using cordova (Android) platform on ubuntu 14.04.

for unsigned i used command

$ cordova build --re         


        
相关标签:
2条回答
  • 2021-01-16 09:36

    Create a keystock for signed apk

    a.  keytool -genkey -v -keystore NAME-mobileapps.keystore -alias NAMEmobileapps -keyalg RSA -keysize 2048 -validity 10000
    b.  create a file inside android folder using name "ant.properties"
    c.  Add these line with your keystock full path and alise name.
        key.store=/home/chandradeo/xxx.keystore
        key.alias=xxx
    

    Run command

    $ cordova build android --release
    

    or

    $ cordova build --release android
    

    This will give you both signed and unsigned apk under ant-build folder

    Thanks

    0 讨论(0)
  • 2021-01-16 09:42

    For you to be able to install the unsigned package in your device, you need to allow installation from unknown sources. It can be done in Settings -> General (tab) -> Security where you need to check the Unknown sources check box. After that the install should work.

    If you want to sign your application to be deployable to for example Play store, you need to refer to Android tutorial on that subject. you can also find steps for this from Stack Overflow. Once you have signed your .apk, you don't need to allow the unknown sources anymore.

    0 讨论(0)
提交回复
热议问题