Created
April 13, 2018 02:22
-
-
Save masukomi/be48ef9f801c3632f15210c3066c50fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[insert command to compile your app here] | |
# copy all the optional ones | |
rm -rf dylibs/* | |
# REPLACE path/to/my/new/binary below with the path to your newly compiled binary | |
DYLIBS=`otool -L path/to/my/new/binary | grep "/opt" | awk -F' ' '{ print $1 }'` | |
for dylib in $DYLIBS | |
do | |
echo "- copying $dylib" | |
base=$(basename $dylib) | |
cp $dylib dylibs/ | |
# if you can figure out a way to use the 3 magic variables to provide you with a predicatable path | |
# then you can use install_name_tool | |
# REPLACE path/to/my/new/binary below with the path to your newly compiled binary | |
# install_name_tool -change $dylib "/some/known/path/on/target/computer/$(basename $dylib)" path/to/my/new/binary | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment