Zipalign优化apk之demo

来源:互联网 发布:二级顶级域名有哪些 编辑:程序博客网 时间:2024/05/16 17:04

我们一般在给apk签过名将要发布新的Application之前,需要对其apk进行优化。方法是,把完整的apk再打包为zip包,然后调用zipalign工具:

Usage: zipalign [-f] [-v] <align> infile.zip outfile.zip
       zipalign -c [-v] <align> infile.zip

  <align>: alignment in bytes, e.g. '4' provides 32-bit alignment
  -c: check alignment only (does not modify file)
  -f: overwrite existing outfile.zip
  -v: verbose output

D:\android-sdk-windows\tools>zipalign -f -v 4 D:\AndroidTest.zip D:\AndroidTest_
zipalign.zip
Verifying alignment of D:\AndroidTest_zipalign.zip (4)...
      45 AndroidTest.apk (OK - compressed)
Verification succesful

 

原创粉丝点击