确定可执行文件(或库)是 32 位还是 64 位
是否可以获取有关 OS X 上任何二进制文件的信息以确定它是 32 位还是 64 位二进制文件?
我使用了“otool”命令,但找不到此类信息。
Is it possible to get information about any binary on OS X to determine if it's a 32 bit or 64 bit binary?
I played with the 'otool' command but can't find this kind of information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
file
命令而不是otool
。它将列出二进制文件中的所有架构。在 Intel Mac 上,i386 是 32 位,x86_64 是 64 位。Use the
file
command instead ofotool
. It will list all the architectures in the binary. On Intel Macs i386 is 32 bit and x86_64 is 64 bit.Nicholas 在评论中指出,
lipo -info
也有效。这是您必须在静态库上使用的内容,因为file
仅显示“当前 ar 存档随机库”。From Nicholas in a comment,
lipo -info
also works. This is what you must use on static libraries, sincefile
only displays "current ar archive random library."