LSEnvironment section of info.plist take no effects.

北战南征 提交于 2020-01-03 16:50:04

问题


I writed a dynamic library that loaded into some target applications by setting environment variable named DYLD_INSERT_LIBRARIES, the dylib load and 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

Then I set the value of DYLD_INSERT_LIBRARIES by editing LSEnvironment section in info.plist file. Some apple standard applications such as TextEdit and Calculator load my library successfuly but this settings take no effect over applications such as InDesign , Photoshop , ...

Why envronment variables do not set for some applications? Does anyone have an idea about it? Thankyou.


回答1:


As you did not further specify, I assume you launch Photoshop and the like via terminal too (?) Which renders these environment variables set in LSEnvironment ineffective as these are only used by processes started via "Launch Services"...

If you start it via "Launch Services", did you check that your library is not simply unloaded via dlclose() by the program?...



来源:https://stackoverflow.com/questions/10535085/lsenvironment-section-of-info-plist-take-no-effects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!