转自:https://developer.apple.com/library/content/technotes/tn2239/_index.html#//apple_ref/doc/uid/DTS40010638-CH1-SUBSECTION21
Dynamic Linker (dyld)
The dynamic linker (dyld) supports a number of debugging facilities that you can enable via environment variables. These are fully documented in the manual page. Table 6 lists some of the more useful variables.
Variable | Summary |
---|---|
DYLD_IMAGE_SUFFIX | Search for libraries with this suffix first |
DYLD_PRINT_LIBRARIES | Log library loads |
DYLD_PRINT_LIBRARIES_POST_LAUNCH | As above, but only after main has run |
DYLD_PRINT_OPTS [1] | Print launch-time command line arguments |
DYLD_PRINT_ENV [1] | Print launch-time environment variables |
DYLD_PRINT_APIS [1] | Log dyld API calls (for example, dlopen) |
DYLD_PRINT_BINDINGS [1] | Log symbol bindings |
DYLD_PRINT_INITIALIZERS [1] | Log image initialization calls |
DYLD_PRINT_SEGMENTS [1] | Log segment mapping |
DYLD_PRINT_STATISTICS [1] | Print launch performance statistics |
Notes:
-
On the Mac OS X side these are only available on Mac OS X 10.4 and later. They are, however, available on all versions of iOS.
While these environment variables are implemented on iOS, many of them have limited utility because of the restricted environment on that system.