macos 如何在mac OS中观察静态库的内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11540478/
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 observe the content of static lib in mac OS?
提问by qiushuitian
I create a static library project in my xCode and build a .a named mylib.a. There some code (.m files) and another static lib file named common.a to inform the static library nylib.a. But I doubt that if the contend of common.a are pack in the mylib.a really. So how can I observe the content of the mylib.a in mac OS? I knew there are some command such as ar, nm to complete this task in Linux. but It does't run in mac OS.
我在我的xCode 中创建了一个静态库项目并构建了一个名为 mylib.a的.a。有一些代码(.m 文件)和另一个名为 common.a 的静态库文件来通知静态库 nylib.a。但是我怀疑common.a的竞争是否真的被打包在mylib.a中。那么如何在mac OS中观察mylib.a的内容呢?我知道在 Linux 中有一些命令,例如 ar、nm 来完成这个任务。但它不能在 mac OS 中运行。
回答by Michael Dautermann
"nm
" most certainly does exist on the Mac (in the "/usr/bin/
" folder).
“ nm
”肯定存在于 Mac 上(在“ /usr/bin/
”文件夹中)。
If you do not see it there, then you probably need to install the "Command Line Tools for Xcode" that you'll find at https://developer.apple.com/downloads/index.action(you'll need an Apple Developer login to get access to this).
如果您在那里没有看到它,那么您可能需要安装“Xcode 命令行工具”,您可以在https://developer.apple.com/downloads/index.action(您需要一个 Apple开发人员登录以访问此)。
"nm
" will dump all the symbols in a static library file for you. Here is the manual page for it.
" nm
" 将为您转储静态库文件中的所有符号。这是它的手册页。