API call to get processor architecture

后端 未结 8 2036
野的像风
野的像风 2020-12-05 01:59

As part of my app I\'m using the NDK and was wondering if it\'s worth bundling x86 and mips binaries alongside the standard ARM binaries.

I figured the best way woul

8条回答
  •  旧巷少年郎
    2020-12-05 02:46

    You can use adb command

    adb shell getprop ro.product.cpu.abi adb shell getprop ro.product.cpu.abi2

    and refer the [site]: How to know a process of an app is 32-bit or 64-bit programmatically in Android lollipop?

    If you're looking for the Lollipop API

    import android.os.Build;
    
    Log.i(TAG, "CPU_ABI : " + Build.CPU_ABI);
    Log.i(TAG, "CPU_ABI2 : " + Build.CPU_ABI2);
    Log.i(TAG, "OS.ARCH : " + System.getProperty("os.arch"));
    
    Log.i(TAG, "SUPPORTED_ABIS : " + Arrays.toString(Build.SUPPORTED_ABIS));
    Log.i(TAG, "SUPPORTED_32_BIT_ABIS : " + Arrays.toString(Build.SUPPORTED_32_BIT_ABIS));
    Log.i(TAG, "SUPPORTED_64_BIT_ABIS : " + Arrays.toString(Build.SUPPORTED_64_BIT_ABIS));
    

提交回复
热议问题