在項目中引入so庫時,有時候需要知道android設(shè)備的CPU架構(gòu)信息,,可通過以下方式知曉當前設(shè)備的CPU架構(gòu)信息.
ADB命令查看Android的CPU型號架構(gòu)等信息
進入shell命令后(adb shell) 執(zhí)行 cat /proc/cpuinfo
執(zhí)行結(jié)果
JAVA代碼獲取CPU架構(gòu)信息
/**
* 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", ",");