6

I'm working on mac OS 10.7.4. using Xcode 4.3.2 .

I had a *.a static library file from my partner. I want to know which architecture it is built for. Is it ARMv6, ARMv7, i386 or other architecture?

Is there any command or method to get info about the architecture of the file?

qiushuitian
  • 1,261
  • 4
  • 19
  • 31

2 Answers2

10

You can use otool to find out the architecture(s) of a file: otool man page

otool -hv mylibrary.a
4

The Unix/Linux file command will tell you what kind of file it is:

% file a.out
a.out: Mach-O 64-bit executable x86_64
Peter Gluck
  • 8,168
  • 1
  • 38
  • 37
  • I mean mostly randomly. Also, its output is not canonical - it can even vary from release to release (note I'm not saying it's wrong, I'm just saying that otool is specifically designed for such operations). –  Aug 17 '12 at 07:17
  • 2
    Example of when file doesnt print the architecture. "file libnanomsg.a" outputs "libnanomsg.a: current ar archive random library" – neoneye May 15 '14 at 22:24
  • 1
    Doesn't print for me on OS X Maverick – huggie Feb 22 '15 at 12:52