Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Dunno if there's a way to specify that inside Xcode or not, but for our app we use a build script that includes some code like the following. The code uses Apple's install_name_tool utility to modify the application so that instead of pointing to /usr/lib/libsndfile.so, it points to a libsndfile.so path that is in the application's package instead.</p> <p>Note this is just a cut-down script excerpt to give you an idea; it will probably require some tweaking before it works for you (and of course you'll need to modify it to operate on other libraries besides libsndfile if that is what you want):</p> <pre><code>#!/bin/bash -e BINARY="MyAppFolder/MyAppName" FRAMEW_FOLDER="MyAppFolder/MyAppName/Contents/Frameworks/" function DoInstallNameTool { xLIB="$1" xLIB_NAME="$2" xBINARY="$3" echo install_name_tool -change \"${xLIB}\" \"@executable_path/../Frameworks/${xLIB_NAME}\" \"${xBINARY}\" install_name_tool -change ${xLIB} "@executable_path/../Frameworks/${xLIB_NAME}" "${xBINARY}" } for LIB in $(otool -L "${BINARY}"|grep libsndfile|cut -d '(' -f -1) do echo "Handling Lib: $LIB" LIB_NAME=$(basename "$LIB") echo " Adding ${LIB_NAME}" cp -Rf "${LIBSNDFILE_DIR}/src/.libs/${LIB_NAME}" "${FRAMEW_FOLDER}" DoInstallNameTool "$LIB" "$LIB_NAME" "$BINARY" done </code></pre> <p>After the script runs, you can do a </p> <pre><code>otool -L ./MyApp.app/Contents/MacOS/MyApp </code></pre> <p>to print out all the shared libraries the app depends on, to verify that the script worked (or if it didn't work, to see what /usr/lib/* libraries the app is still dynamically linked to)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload