Android studio 过去生成 1 个发布版 apk,现在是 3 个.它们分别是做什么的? [英] Android studio used to generate 1 release apk, now it's 3. What does each of them do?

查看:20
本文介绍了Android studio 过去生成 1 个发布版 apk,现在是 3 个.它们分别是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我已经有一段时间没有发布了.Android Studio 过去只生成一个 apk,这是一个发布版本.这次它生成了 3 个,如下所示:

So I haven't released in a while. Android Studio used to generate only one apk, which was a release version. This time it generated 3 like the following:

1.app-armeabi-v7a-release.apk
2.app-x86-release.apk
3.app-universal-release.apk

我假设我想在 Google Play 商店中使用通用的.
但是有人可以分解每一个的细节吗?

I'm going to assume that I want to use the universal one for the Google Play Store.
But can someone break down the specifics of each one?

推荐答案

每个生成的 apk 都是针对特定 CPU 架构的.它们通常是在 apk 中使用本机库时生成的(更多见 AddC 和 C++ 代码到您的项目).您可以在 ABI Management 中阅读有关它的信息,这里是摘录:

The generated apks each is for specific CPU Architecture. They usually are generated when using a native library inside the apk (more at Add C and C++ Code to Your Project). You can read about it in ABI Management, here the excerpt:

不同的 Android 手机使用不同的 CPU,进而支持不同的指令集.CPU和指令的每种组合集合有自己的应用程序二进制接口,或 ABI.ABI非常精确地定义了应用程序的机器代码是如何应该在运行时与系统交互.您必须指定一个您希望应用使用的每种 CPU 架构的 ABI.

Different Android handsets use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction sets has its own Application Binary Interface, or ABI. The ABI defines, with great precision, how an application's machine code is supposed to interact with the system at runtime. You must specify an ABI for each CPU architecture you want your app to work with.

app-universal-release.apk外,每个都包含针对架构的特定说明.

Each will contain specific instruction for the Architecture, except the app-universal-release.apk.

app-armeabi-v7a-release.apk 适用于 v7-a ARM 设备

app-x86-release.apk 适用于 x86"或IA-32"

app-universal-release.apk 包含 app-armeabi-v7a-release.apkapp-x86-release 中的具体指令.apk

app-universal-release.apk contains both of the specific instruction in app-armeabi-v7a-release.apk and app-x86-release.apk

您可以只使用通用的,但如果生成的 apk 太大,您可能不想使用它.用户倾向于避免在 Play 商店中使用大型应用程序.因此,要克服这一点,您需要将 apk 分解为特定的 apk,以便生成的 apk 更小.

You can use just the universal one, but you probably will not want to use it if the generated apk is too big. User tend to avoid a big application in the play store. So, to overcome this, you need to break the apk to a specific one so the resulted apk is smaller.

如果您不想使用通用的,那么您需要将每个特定的 apk 上传到 Play 商店.当用户在 Play 商店中访问应用程序时,他/她将获得与其设备 CPU 类型匹配的特定 apk.

If you don't want to use the universal one, then you need to upload each of the specific apk to the Play Store. When user visit the application in the Play Store, he/she will be served with the specific apk matching with his/her device CPU type.

这篇关于Android studio 过去生成 1 个发布版 apk,现在是 3 个.它们分别是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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