Using otool to list dependencies of a system library in dynamic library cache

Apple Recommended

Replies

I didn't find a way to get this working with otool. Nor could I find a tool which would seamlessly work against dependency paths of the system libraries which don't represent a file system path but instead are in within the dynamic library cache.

However, I did find a workaround. I found this useful tool https://github.com/keith/dyld-shared-cache-extractor which extracts the dynamic cache library to a directory. The dynamic library cache is available on the filesystem as a file under /System/Library/dyld/ directory. For example, /System/Library/dyld/dyld_shared_cache_arm64e. So you can pass that file as an argument to the tool to extract the contents.

Once you extract the cache, you can then use otool to list the dependencies of the system library of your choice, as usual. Do note though that the extracted content is around 2.7 GB.