Skip to content

Instantly share code, notes, and snippets.

@sukima
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sukima/9494083 to your computer and use it in GitHub Desktop.
Save sukima/9494083 to your computer and use it in GitHub Desktop.
#!/bin/bash
tmpdir=`mktemp -dt ios-sim.XXX`
buildpath="./build/Release/ios-sim"
destdir="$HOME/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/iphone"
success=false
pushd $tmpdir
git clone git@github.com:phonegap/ios-sim.git .
npm install .
if [ -e "${buildpath}" ]; then
mv "${destdir}/ios-sim" "${destdir}/ios-sim.orig"
if [ -e "${destdir}/ios-sim.orig" ]; then
cp "${buildpath}" "${destdir}/ios-sim"
success=true
fi
fi
popd
if $success; then
rm -rf $tmpdir
else
echo "There was a problem with the build. Please try manually." >&2
echo "ios-sim in ${buildpath}" >&2
echo "Titanium destination: ${destdir}" >&2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment