bashmacosotoolinstall-name-tool

Mac OS X: How to get result of otool inside a script?


I'd like to change dylib search path in a script. In the Terminal I use otool -L my.dylib, then see what is the search path and to change it use install_name_tool. The install_name_tool (-change) uses previous path and the new path as a arguments. How I can get result of otool -L to a script variable?


Solution

  • How I can get result of otool -L to a script variable?

    Run otool from the script:

    OUTPUT=$(otool -L /Applications/Calculator.app/Contents/MacOS/Calculator)
    echo $OUTPUT