ios 如何检查静态库是否是为 64 位构建的?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18992840/
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
How to check if a static library is built for 64-bit?
提问by Joel Fischer
I just built a static library for iOS with the build setting for Architectures set to $(ARCHS_STANDARD_INCLUDING_64_BIT)
.
我刚刚为 iOS 构建了一个静态库,并将 Architectures 的构建设置设置为$(ARCHS_STANDARD_INCLUDING_64_BIT)
.
I want to make sure that the .a library is properly including that architecture, but when i run lipo -info
on it, I see:
我想确保 .a 库正确包含该架构,但是当我运行lipo -info
它时,我看到:
Architectures in the fat file: library.a are: armv7 armv7s (cputype (16777228) cpusubtype (0))
胖文件:library.a 中的架构是: armv7 armv7s (cputype (16777228) cpusubtype (0))
Does this mean that arm64 isn't included? If the lipo command can't tell me, is there another way to tell?
这是否意味着不包括 arm64?如果 lipo 命令不能告诉我,还有其他方法可以告诉我吗?
I'm running Xcode 5 with the latest Command Line Tools installed.
我正在运行 Xcode 5,并安装了最新的命令行工具。
回答by Stephen Canon
Yes, an arm64 slice is there. To see it, you need to use lipo
from the iOS toolchain, not from the host system (which doesn't know about arm64):
是的,有一个 arm64 切片。要查看它,您需要lipo
从 iOS 工具链中使用,而不是从主机系统(它不了解 arm64):
xcrun -sdk iphoneos lipo -info $(FILENAME)
回答by Nikolai Ruhe
good old file
can do the trick, too:
老好人file
也可以做到:
$ file libTestFlight.a
libTestFlight.a: Mach-O universal binary with 5 architectures
libTestFlight.a (for architecture armv7): current ar archive random library
libTestFlight.a (for architecture armv7s): current ar archive random library
libTestFlight.a (for architecture i386): current ar archive random library
libTestFlight.a (for architecture x86_64): current ar archive random library
libTestFlight.a (for architecture cputype (16777228) cpusubtype (0)): current ar archive random library
It seems that nobody at Apple cared to add the arm64 cputype to file
, yet.
似乎 Apple 没有人愿意将 arm64 cputype 添加到 中file
。
Interestingly, in the iOS 7 Tech Talk Videos ("Architecting Modern Apps, Part 2", PDF page 35) they show a working file tool's output:
有趣的是,在 iOS 7 Tech Talk Videos(“Architecting Modern Apps, Part 2”, PDF page 35)中,他们展示了一个工作文件工具的输出:
回答by Matthieu Riegler
For a .framework
为一个 .framework
lipo -info myFramework.framework/MyFramework
lipo -info myFramework.framework/MyFramework