本文概述
根据android开发人员网站上的发布文章, 在将应用程序启动到Play商店之前, 需要使用zipalign对其进行签名和压缩。
对于某些开发人员而言, 出于多种原因(而不是如何做, 你的应用程序是使用混合技术创建的), 很容易手动使用android studio来执行此过程。要签名我们的android应用程序, 请按照以下步骤操作。
在继续之前, 请确认你已在PC中安装了Java开发工具包和android SDK, 否则你将迷失在步骤中。
切记始终在管理员模式下执行cmd。
1.创建一个自签名证书。
该证书稍后将用于对你的apk进行签名, 以生成证书, 我们需要使用控制台(cmd)转到PC上的java sdk bin路径
# Usually is located in C:\Program Files (x86)\Java\jdk1.7.0_71\bin , but anyway check the location on your pc.
# Then in the cmd type :
C:\ > cd C:\Program Files (x86)\Java\jdk1.7.0_71\bin
# You'll be located in the bin path and we can use all the java tools.
C:\Program Files (x86)\Java\jdk1.7.0_71\bin >
当你通过控制台位于bin路径中时, 执行以下命令:
REM Remember to change the mycustomname and mycustom_alias to your correct keystore name and alias (whatever you want)
keytool -genkey -v -keystore mycustomname.keystor