调试和发布 apk 之间的区别 [英] Difference between debug and release apks

查看:20
本文介绍了调试和发布 apk 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 android 和 android studio 的新手.根据我在 Visual Studio 的经验,当我们在另一台机器上测试 .exe 时,我们复制了发布文件夹和 .exe.

I am new to android as well as android studio. From my experience in visual studio, when we test the .exe in another machine we copy the release folder and .exe.

但在 android studio 中,我看到我的同事通过使用 USB 驱动器在其他系统中复制和部署来测试调试 apk.似乎也工作.我可以知道部署该版本的后果是什么吗?发布版本是否仅与 Play 商店相关?

But in android studio I am seeing my colleagues test the debug apk by copying and deploying in other systems using USB drive. seems working also. May I know what is the consequence of deploying that version? Is the release version relevant only for a play store purpose?

除了调试版本包含可能使其缓慢或庞大的调试信息之外,还有什么技术差异/后果?

What is the technical difference/consequence other than that debug version contains debug information which may makes it slow or bulky?

推荐答案

主要区别在于调试标志和签名密钥:

Major differences are the debug flag and the signing keys:

  • 对于调试版本,apk 将使用启用调试标志的默认调试签名密钥进行签名.

  • For debug builds the apk will be signed with the default debug signing keys with debug flag enabled.

对于发布密钥,您必须明确指定要签名的密钥,并且调试标志将被关闭,以便无法对其进行调试.

For release keys you will have to explicitly specify the keys to sign with and the debug flag will be turned off so that it cannot be debugged.

可以为发布版本打开 Proguard.(也用于调试版本,但不建议).这一步需要显式完成,默认为false.

Proguard can be turned on for release builds. (also for debug builds but not advised). This step needs to be done explicitly and is false by default.

注意:这些内容可以在您的 build.config 中更改,您可以选择任何您想要的排列和组合.

Note: these things can be altered in your build.config and you can choose what ever permutation and combination you wish.

这篇关于调试和发布 apk 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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