Python armeabi-v7a、arm64-v8a、x86有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/56824557/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:38:22  来源:igfitidea点击:

What is the difference between armeabi-v7a, arm64-v8a, x86?

androidpythonkivy

提问by Chitkaran Singh

I am working on an Android App on Kivy. I am using Buildozer to compile an APK file. In the Buildozer spec file, there's a setting android.arch = armeabi-v7a, I didn't understand this.

我正在 Kivy 上开发 Android 应用程序。我正在使用 Buildozer 来编译一个 APK 文件。在 Buildozer 规范文件中,有一个设置android.arch = armeabi-v7a,我不明白这一点。

Also, when I generated the APK file using the command buildozer -v android debugand installed it using the command adb install bin/<appname>.apk- it didn't Open on my Android Phone.

此外,当我使用命令生成 APK 文件并使用命令buildozer -v android debug安装它时adb install bin/<appname>.apk- 它没有在我的 Android 手机上打开。

Please help me guys !

请帮帮我!

回答by inclement

These are CPU instruction sets. Mostly you don't have to worry about it, the default is fine, but I've been meaning to add something to the docs about it due to some recent changes.

这些是 CPU 指令集。大多数情况下您不必担心它,默认值很好,但是由于最近的一些更改,我一直想在有关它的文档中添加一些内容。

Basically, a given Android device might have an arm or an x86 cpu (or even something else but that's not important), these are just different architecture types from different manufacturers. Arm cpus are most common, but x86 is not unusual. When you compile code, the output depends on the architecture target. When you build a Kivy app, you specify one of the architectures and then the app will only work on that type of the device. If you want to support all devices, you can compile multiple APKs to distribute - the Play store will let you upload more than one, and will send each device the right one.

基本上,给定的 Android 设备可能有一个 arm 或 x86 cpu(甚至其他东西,但这并不重要),这些只是来自不同制造商的不同架构类型。Arm CPU 是最常见的,但 x86 并不罕见。编译代码时,输​​出取决于架构目标。当您构建 Kivy 应用程序时,您指定其中一种架构,然后该应用程序将仅在该类型的设备上运行。如果你想支持所有设备,你可以编译多个 APK 来分发 - Play 商店会让你上传多个,并且会为每个设备发送正确的一个。

Within a given architecture type there are multiple versions. armeabi-v7a is the older target, for 32 bit arm cpus, almost all arm devices support this target. arm64-v8a is the more recent 64 bit target (similar to the 32-bit -> 64 bit transition in desktop computers). I think most new devices are 64 bit, but not sure. arm64-v8a devices can run code compiled against armeabi-v7a, it's backwards compatible.

在给定的架构类型中,有多个版本。armeabi-v7a 是较旧的目标,对于 32 位 arm cpus,几乎所有 arm 设备都支持此目标。arm64-v8a 是最新的 64 位目标(类似于台式计算机中的 32 位 -> 64 位转换)。我认为大多数新设备都是 64 位的,但不确定。arm64-v8a 设备可以运行针对 armeabi-v7a 编译的代码,它向后兼容。

As of later this year, the Play store will require you to upload an arm64-v8a APK as the minimum, because this gives the best support for newer devices. You will also be able to upload other APKs to support other device types.

从今年晚些时候开始,Play 商店将要求您至少上传 arm64-v8a APK,因为这可以为较新的设备提供最佳支持。您还可以上传其他 APK 以支持其他设备类型。

That isn't quite the full story: some x86 devices have a special library that lets them run code compiled for arm devices. I'm not sure how widespread this is, but it seems pretty common.

这还不是全部:一些 x86 设备有一个特殊的库,可以让它们运行为 arm 设备编译的代码。我不确定这有多普遍,但它似乎很常见。

For your app issue, use adb logcatto see what's wrong.

对于您的应用程序问题,请使用adb logcat查看问题所在。