确定可执行文件(或库)是 32 位还是 64 位

发布于 2024-08-15 18:55:50 字数 89 浏览 2 评论 0原文

是否可以获取有关 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱你是孤单的心事 2024-08-22 18:55:50

使用 file 命令而不是 otool。它将列出二进制文件中的所有架构。在 Intel Mac 上,i386 是 32 位,x86_64 是 64 位。

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.

心意如水 2024-08-22 18:55:50

Nicholas 在评论中指出,lipo -info 也有效。这是您必须在静态库上使用的内容,因为 file 仅显示“当前 ar 存档随机库”。

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."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文