获取Android的CPU型号

在项目中引入so库时,有时候需要知道android设备的CPU架构信息,,可通过以下方式知晓当前设备的CPU架构信息.

ADB命令查看Android的CPU型号架构等信息

进入shell命令后(adb shell) 执行 cat /proc/cpuinfo

执行结果

JAVA代码获取CPU架构信息


/**
     * The name of the instruction set (CPU type + ABI convention) of native code.
     * @deprecated Use {@link #SUPPORTED_ABIS} instead.
     */
String cpuInfo = android.os.Build.CPU_ABI;

注释告诉我们,该属性已被废弃使用,建议使用SUPPORTED_ABIS代替

/**
     * An ordered list of ABIs supported by this device. The most preferred ABI is the first
     * element in the list.
     *
     * See {@link #SUPPORTED_32_BIT_ABIS} and {@link #SUPPORTED_64_BIT_ABIS}.
     */
    public static final String[] SUPPORTED_ABIS = getStringList("ro.product.cpu.abilist", ",");
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容