On Windows there is a tool Depends.exe to discover dependency of an EXE/DLL file on other DDLs. Which commandline tool is equivalent on Mac OS and Linux?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
- Mac OS X:
otool
-L
file - Linux:
ldd
file
If those commands don't provide what you want, on Mac OS X you can dump all the load commands with otool
-l
file. On Linux you can dump the entire contents of the dynamic section with readelf
-d
file.
回答2:
You can also try MacDependency (http://macdependency.googlecode.com) which provides an UI replacement for otool on MacOS X. It shows complete dependency trees and the exported symbols as well.
回答3:
try ldd in the terminal. This will provide you a list of dynamic libraries that the binary needs.