- open Terminal.app
- export DYLD_INSERT_LIBRARIES="path_to_dylib"
- env
Result:
-
x86: no DYLD_INSERT_LIBRARIES environment is printed.
-
M1 pro:
dyld[1393]: tried: '/usr/local/lib/***.dylib' (fat file, but missing compatible architecture (have 'x86_64,arm64', need '')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/***.dylib' (no such file), '/usr/local/lib/***.dylib' (fat file, but missing compatible architecture (have 'x86_64,arm64', need ''))