macos 确定可执行文件(或库)是 32 位还是 64 位
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1941825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Determine if an executable (or library) is 32 or 64 bit
提问by jideel
Is it possible to get information about any binary on OS X to determine if it's a 32 bit or 64 bit binary?
是否可以获取有关 OS X 上任何二进制文件的信息以确定它是 32 位还是 64 位二进制文件?
I played with the 'otool' command but can't find this kind of information.
我使用了“otool”命令,但找不到此类信息。
回答by Grant Lammi
Use the file
command instead of otool
. It will list all the architectures in the binary. On Intel Macs i386 is 32 bit and x86_64 is 64 bit.
使用file
命令而不是otool
. 它将列出二进制文件中的所有架构。在 Intel Mac 上,i386 是 32 位,x86_64 是 64 位。
回答by greg
From Nicholas in a comment, lipo -info
also works. This is what you must use on static libraries, since file
only displays "current ar archive random library."
来自尼古拉斯的评论,lipo -info
也有效。这是您必须在静态库上使用的内容,因为file
只显示“当前 ar 存档随机库”。