I am new to MacOS & MacOS programming. I would like to know how an application is working (by simply having a glimpse of the binary's imported system APIs for learning).
I tried otool, printed the help message, I saw the message says -L prints the shared libraries used. Then I ran otool -L <binary-file>, but it only printed the names of the used libraries, without any imported symbols.
Maybe I missed something in otool, or is there any other tool that can help get import symbols in a mach-o binary?
You can get a simple list of imported symbols with
nm -u:For more detailed information, including the library that each symbol is expected to come from, you can use
dyldinfo. This requires Xcode though, and has to be invoked asxcrun dyldinfo. You'll want the union of-bind,-weak_bindand-lazy_bind: