2

If I run otool -L ... on the main executable of my iOS .ipa file, I see the following output:

/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation /System/Library/Frameworks/UIKit.framework/UIKit ... @rpath/DMSDK.framework/DMSDK ... /usr/lib/libz.1.dylib /usr/lib/libc++.1.dylib /usr/lib/libiconv.2.dylib /usr/lib/libsqlite3.dylib

This tells me the dynamic libraries that are used/referenced/required by my app.

My question: do these refer to global directories that exist on the ios device itself? I believe the answer's yes, but wouldn't that imply that all iOS devices already have libsqlite installed on them (I'd only find this surprising because as a web dev I thought sqlite was more of a userspace thing and I'd be surprised it'd have enough support from Apple to be a pre-installed dylib)?

How come some dylibs originate from /System/Library/Frameworks and some from /usr/lib/...? I can find a list of iOS frameworks, but where can I find the list of supported dylibs built into iOS devices?

1 Answers1

4

Most of those do refer to libraries on the iOS device, because they must be available when the app launches on the device. The @rpath entry refers to something bundled with the app, but anything beginning with / is included with iOS. All iOS devices have SQLite installed, because it's used by various Apple frameworks (Core Data, and also internally by others). For what it's worth SQLite is also a standard part of macOS, for the same reason.

In most cases the /System paths refer to frameworks provided by Apple, which include a dynamic library as well as resources (images, sounds) used by the framework. [When developer tools are on a Mac, frameworks also include header files.] The /usr/lib/ paths are anything else, including third-party open source libraries like SQLite as well as anything with a more Unix-style dynamic library.

Outside of an iOS device itself the only way I know to find a list of included libraries is to install Xcode on a Mac and browse /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib (there are similar paths for Apple Watch and Apple TV). For what it's worth, here's a gist of what I get with Xcode 8.3.2.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • I'm sure this is answered elsewhere but looking through the rest of the iPhoneOS.platform directory I only see headers and .tbd files; is it correct to say/think that `.tbd` files are only there to describe which dylibs / symbols _will_ be present on the target device (without having to actually provide real dylibs in that directory that need to be inspected with otool/nm/etc?) – Alexander Wallace Matchneer Sep 20 '17 at 19:38
  • Yes, I should have mentioned that. The `tbd` files are text files, and you can look at the contents to see the symbols that will be available on the iOS device. – Tom Harrington Sep 20 '17 at 20:23