问题描述
为了识别Android设备的平台,java系统属性os.arch"似乎就足够了:
In order to identify the platform of an Android device, it seems that the java system property "os.arch" will suffice:
Log.i("mytag", "os.arch: " + System.getProperty("os.arch"));
大多数 ARM 设备响应:os.arch: armv7l
most ARM devices respond: os.arch: armv7l
x86 模拟器响应:os.arch: i686
对于真实 Intel 和 MIPS 设备的输出是什么?
What are the outputs of this for real Intel and MIPS devices?
x86 Android 设备:??????
x86 Android device: ??????
mips Android 设备:??????
mips Android device: ??????
还有其他平台和变体吗?
Any other platforms and variants?
为 Google TV
EDIT for Google TV:
Google TV 似乎对构建代码使用了无".
It looks like Google TV uses 'none' for Build code.
Vizio 联合主演:os.arch: armv7l , Build.CPU_ABI/Build.CPU_ABI2: none/unknown
Vizio Co-Star: os.arch: armv7l , Build.CPU_ABI/Build.CPU_ABI2: none/unknown
罗技 Revue:os.arch:i686,Build.CPU_ABI/Build.CPU_ABI2:无/未知
Logitech Revue: os.arch: i686 , Build.CPU_ABI/Build.CPU_ABI2: none/unknown
为澄清意图而
这里的目标是众包真实设备列表的编译及其输出.AOSP 代码的预期输出很有趣,但设备制造商(如上面的旧 Google TV 设备)可能会偏离提供 AOSP 代码的预期输出.
The goal here is to crowdsource the compilation of a list of real devices with their output. The expected output from AOSP code is interesting, but device manufacturers, like the old Google TV units above, may deviate from supplying the output expected from AOSP code.
推荐答案
根据我在 Android 源代码树中可以找到的 ro.product.cpu.abi
属性(您可以作为CPU_ABI
通过 Build 类)应该具有以下架构到值的映射:
According to what I can find in the Android source tree the ro.product.cpu.abi
property (which you can access as CPU_ABI
through the Build class) should have the following architecture-to-value mapping:
ARM:armeabi-v7a";(或者可能是armeabi",如果它是一个非常旧/低端的设备)
ARM: "armeabi-v7a" (or possibly "armeabi" if it's a really old / low-end device)
x86:x86"
MIPS:mips"
ARM:arm64-v8a"
ARM: "arm64-v8a"
x86:x86_64"
MIPS:mips64"
这篇关于ARM、MIPS、x86 的 Android os.arch 输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!