Library insertion/injection not work with open command

397 views Asked by At

I writed a dynamic library that loaded into target application by environment variable DYLD_INSERT_LIBRARIES, the dylib works fine when application executed from terminal by this commands:

$ export DYLD_INSERT_LIBRARIES=/path/to/mylib.dylib
$ /path/to/application.app/Contents/MacOS/executable

but when execute it by open command:

$ open /path/to/application.app

this error occured:

dyld: could not load inserted library:

what is difference between two method of execution? thanks.

1

There are 1 answers

0
mh taqia On BEST ANSWER

The reason of this issue was that my dylib is 32bit and it first load into "open" which is 64bit.