0

I want to print shared object dependencies of ios app in linux script for crash parsing.

But I am getting following error while executing commands. 1) ldd ./demoApp.app not a regular file 2) ldd ./demoApp.ipa not a dynamic executable 3) ldd ./demoApp.app.dSYM/Contents/Resources/DWARF/demoApp not a dynamic executable

What argument I should pass to ldd to print the dependencies.

Bhupesh Kumar
  • 369
  • 2
  • 18

2 Answers2

0

I have not used ldd (I don't use Linux), but I would start with man ldd to determine appropriate arguments. Also ldd ./demoApp.app/demoApp should get you past the error messages above.

  1. demoApp.app is an app bundle, which is a directory hierarchy containing the executable, resources, etc.;
  2. demoApp.ipa is a zip-compressed file containing the app bundle, used for cases like uploading the app to the App Store; and
  3. demoApp.app.dSYM is a file system package (directory hierarchy) that includes the app's symbol data
0

It would surprise me if ldd supports mach-o and the darwin loader formats, and you seem to have demonstrated that it doesn't...

OTOH, lldb is generally built to support reading mach-o object files on linux, so you could use it.

The direct shared library dependencies are stored in the "load commands" of a mach-o binary, and lldb will read those. So just start up lldb, do target create for your .app bundle, and image list will show you the direct dependencies. lldb will recurse through all the direct dependencies to find the closure of the dependencies for that .app, but to do that you would have to have all the directly dependent libraries available (since their dependencies are in the "load commands" of the dependent libraries.) I'm not sure how you would get your hands on those.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63