How to get zipalign for mac?

后端 未结 2 680
暖寄归人
暖寄归人 2021-02-19 22:20

I already have a release unsigned version apk and I am trying to sign it on my mac. On the last step it suggests to zipalign the signed apk but mac doesn\'t have zipalign.

2条回答
  •  耶瑟儿~
    2021-02-19 22:52

    From your Mac terminal:

    Add adb to command line path:

    echo 'export ANDROID_HOME=/Users/$USER/Library/Android/sdk' >> ~/.bash_profile
    

    Add build tools to command line path:

    echo 'export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/build-tools/28.0.2' >> ~/.bash_profile
    

    Refresh command line with:

    source ~/.bash_profile
    

    Then you can run it with:

    zipalign -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk
    

提交回复
热议问题