Android os.arch output for ARM, MIPS, x86?

larham1 picture larham1 · Feb 13, 2013 · Viewed 9.1k times · Source

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"));

most ARM devices respond: os.arch: armv7l

An x86 emulator responds: os.arch: i686

What are the outputs of this for real Intel and MIPS devices?

x86 Android device: ??????

mips Android device: ??????

Any other platforms and variants?

EDIT for Google TV:

It looks like Google TV uses 'none' for Build code.

Vizio Co-Star: os.arch: armv7l , Build.CPU_ABI/Build.CPU_ABI2: none/unknown

Logitech Revue: os.arch: i686 , Build.CPU_ABI/Build.CPU_ABI2: none/unknown

EDIT for clarifying intent:

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.

Answer

Michael picture Michael · Mar 22, 2013

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:

32-bit ABIs:

ARM: "armeabi-v7a" (or possibly "armeabi" if it's a really old / low-end device)

x86: "x86"

MIPS: "mips"


64-bit ABIs:

ARM: "arm64-v8a"

x86: "x86_64"

MIPS: "mips64"