在最近版本的 macOS 上,只要安装了 Xcode,就可以使用 xcrun dyldinfo
工具运行它。
/Library/Developer/CommandLineTools/usr/bin/dyldinfo
dyldinfo
路径:$ xcrun --sdk dyldinfo
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dyldinfo
展示命令dyldinfo
的路径为:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dyldinfo
,这意味着像dyldinfo
这样的命令属于Xcode的工具链。因此,'dyldinfo'不能作为单独的shell命令使用。相反,您必须使用xcrun <sdk>
来调用它。
$ xcrun dyldinfo
Usage: dyldinfo [-arch <arch>] <options> <mach-o file>
-dylibs print dependent dylibs
-dr print dependent dylibs and show any recorded DR info
-rebase print addresses dyld will adjust if file not loaded at preferred address
-bind print addresses dyld will set based on symbolic lookups
-weak_bind print symbols which dyld must coalesce
-lazy_bind print addresses dyld will lazily set on first use
-export print addresses of all symbols this file exports
-opcodes print opcodes used to generate the rebase and binding information
-function_starts print table of function start addresses
-export_dot print a GraphViz .dot file of the exported symbols trie
-data_in_code print any data-in-code information