How to determine binary image architecture at runtime?

前端 未结 3 1150
北荒
北荒 2020-12-29 00:43

Crash log contains \"Binary Images\" section with information about architecture (armv6/armv7) and identifier of all loaded modules. How to determine this information at run

3条回答
  •  失恋的感觉
    2020-12-29 01:32

    For a quick answer about architecture alone since you are building your application you can check some preprocessor defines to determine the current architecture that your application is built for. Make sure you check for the highest version of arm available first because each newer version defines all older versions.

    #if __arm__
    #import 
    
    #ifdef __ARM_ARCH_6K__
    //This is armv6
    #endif //__ARM_ARCH_6K__
    #endif //__arm__
    

提交回复
热议问题