zipalign: command not found

前端 未结 9 2131
Happy的楠姐
Happy的楠姐 2021-01-31 02:51

I\'m working on Ionic project now whereby I want to zipalign the android-release-unsigned.apk file. I followed this guide by Ionic.

When I run

9条回答
  •  Happy的楠姐
    2021-01-31 03:28

    You should do (align, sign, and verify)for APK. In mac, you should do the following steps:

    A - Aligning APK:

    1- you should locate zipalign your build tools inside android SDK:

    /Users/mina/Downloads/sdk/build-tools/29.0.3/zipalign
    

    2- you should locate your unsigned apk:

     /Users/mina/Desktop/apks/app_unsigned.apk
    

    3- you should run command contains:

    zipalign_path + -v -p 4 + unsigned_apk_path + output_aligned_apk_name

    /Users/mina/Downloads/sdk/build-tools/29.0.3/zipalign -v -p 4 
    /Users/mina/Desktop/apks/app-unsigned.apk app_aligned.apk
    

    4- output is Verification successful

    B - Signing APK:

    1- you should locate apksigner your build tools inside android SDK:

    /Users/mina/Downloads/sdk/build-tools/29.0.3/apksigner
    

    2- you should locate your release-Keystore in your pc:

    /Users/mina/Desktop/keys/release-Keystore.jks
    

    3- you should run command contains:

    apksigner_path + sign --ks + release-Keystore_path + --out + output_signed_apk_name + from_aligned_apk_name

    /Users/mina/Downloads/sdk/build-tools/29.0.3/apksigner sign --ks 
    /Users/mina/Desktop/keys/release-keystore.jks                                                    
     --out app_signed.apk app_aligned.apk
    

    4- enter your key store password

    C- Verifying APK:

    1- run the following command : apksigner_path + verify + app_signed.apk

    /Users/mina/Downloads/sdk/build-tools/29.0.3/apksigner verify 
    app_signed.apk
    

    Notes: you may find some warnings:

     WARNING: META-INF/.... 
    

    Here is some description about that:

    Apk Metainfo Warning

    In practice, these files are not important, they're mostly versions of libraries you depend on, so even if someone modified those, it wouldn't have any impact on your app. That's why it's only a warning: those files in your APK can be modified by someone else while still pretending that the APK is signed by you, but those files don't really matter.

    D- find your signed APK:

    /Users/mina/app_signed.apk
    

提交回复
热议问题