如何在Windows中压缩apk文件 [英] How to zipalign the apk file in Windows

查看:122
本文介绍了如何在Windows中压缩apk文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经签名并打包了Xamarin应用程序
因此,已经使用Visual Studio创建了apk文件.

I have signed and packaged the Xamarin application
and so have created the apk file using Visual Studio.

如何在Windows中压缩该文件?

How can I zipalign this file in Windows?

推荐答案

确保已安装 Android SDK构建工具,然后检查SDK的安装位置我的位置是C:\Program Files(x86)\Android\android-sdk\build-tools\23.0.1\zipalign在android构建工具中找到zipAlign,然后像这样使用它:

Make sure you have the Android SDK build-Tools installed then check where your SDK is installed mine was at C:\Program Files(x86)\Android\android-sdk\build-tools\23.0.1\zipalign You will find zipAlign in the android build tools then use it like so:

C:\Program Files(x86)\Android\android-sdk\build-tools\23.0.1\zipalign -v 4 infile.apk outfile.apk

用法

要对齐infile.apk并将其另存为outfile.apk:

To align infile.apk and save it as outfile.apk:

zipalign [-f] [-v] <alignment> infile.apk outfile.apk

要确认existing.apk的对齐方式,请执行以下操作:

To confirm the alignment of existing.apk:

zipalign -c -v <alignment> existing.apk

对齐方式是一个整数,它定义字节对齐边界.该值必须始终为4(提供32位对齐),否则它实际上什么也不做.

The alignment is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.

标志:

-f:覆盖现有的outfile.zip

-f : overwrite existing outfile.zip

-v:详细输出

-c:确认给定文件的对齐方式

-c : confirm the alignment of the given file

从Windows输出(其他参数不在Docs:O中):

output from windows (extra parameters not in the Docs :O) :

Zip alignment utility
Copyright (C) 2009 The Android Open Source Project

Usage: zipalign [-f] [-p] [-v] [-z] <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
-p: page align stored shared object files
-v: verbose output
-z: recompress using Zopfli

ZipAlign文档

这篇关于如何在Windows中压缩apk文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆