How do I determine the target architecture of static library (.a) on Mac OS X?

后端 未结 5 534
再見小時候
再見小時候 2020-12-04 05:33

I\'m interested in verifying if a given iPhone static library has been built for ARM or Intel.

It\'s more curiosity than anything. Is there some kind of Mac OS X o

5条回答
  •  醉酒成梦
    2020-12-04 06:15

    file will probably tell you. otool certainly should be able to. But I'd try file first, e.g.

    logan:/Users/logan% file d2
    d2: Mach-O executable ppc
    

    Example with archive:

    logan:/Users/logan% file /usr/lib/libMallocDebug.a
    /usr/lib/libMallocDebug.a: Mach-O universal binary with 2 architectures
    /usr/lib/libMallocDebug.a (for architecture i386):      current ar archive random library
    /usr/lib/libMallocDebug.a (for architecture ppc):       current ar archive
    

提交回复
热议问题