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.
Asked
Active
Viewed 1.6k times
1 Answers
25
"nm
" most certainly does exist on the Mac (in the "/usr/bin/
" folder).
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).
"nm
" will dump all the symbols in a static library file for you. Here is the manual page for it.

Michael Dautermann
- 88,797
- 17
- 166
- 215
-
1**nm** dumps nothing. Have you tried it on a .so file in Mac OS? – IgorGanapolsky May 10 '16 at 14:03
-
3Running command "`nm -gU ./my-library.a > my-log.txt`" listed more than enough, thanks!! – Top-Master Jul 11 '21 at 09:11