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.
If we want to see the contents of our library, we can use the ar option -t . We can also see the symbols in our library, using the command nm , which lists each symbol's symbol value, symbol type, and symbol name from object files.
To list the symbols stored in the static library we can use the command “nm”, which lists each symbol's symbol value, symbol type, and symbol name from object files.
An XCFramework can be either static or dynamic and can include headers.
"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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With