1.将项目切换到Release。
2.设置andriod版本
3.设置清单信息
包括:应用的名称、apk包的名称、图标、版本号、权限等可随便设置。
3.设置选项信息
要记得将“使用共享运行时”的对勾去掉,否则后面存档会失败。
链接设置为“无”,意味着要将所有的SDK打包到apk中,这样,一个apk至少是40多M。
链接一般设置为 “仅SDK程序集”,表示 apk 使用手机中自带的SDK。
4.存档apk
在发布apk之前,先要“存档”得到apk。
存档前线生成一下,否则会报错
5.分发
“存档”得到的apk不能直接部署到手机真机,运行会闪退。还需要经过最后的“分发”正式发布
在“存档”成功后,会出现如下界面:
点击“分发”按钮,分发频道选择“临时”
进入发布apk的流程。首先,要对apk进行签名:
如果是第一次走这个流程,先要点击绿色的“+”,创建一个密钥文件
然后选择它,再点击“另存为”按钮,即可保存签名后的apk。
这个apk就可以安装在手机上正常使用了。