Skip to content

Instantly share code, notes, and snippets.

@daltonbr
Created January 22, 2019 09:12
Show Gist options
  • Save daltonbr/23a2410b2a8fcd39d759c56d1fc8965d to your computer and use it in GitHub Desktop.
Save daltonbr/23a2410b2a8fcd39d759c56d1fc8965d to your computer and use it in GitHub Desktop.
A bash script to switch Unity builds, this one is for OSX
#!/bin/bash
# https://bonusxp.com/2014/09/fast-platform-switching-in-unity3d/
# $ brew install pidof
# $ chmod +x osxswitchplatform.bash
# ./osxswitchplatform ios
# ./osxswitchplatform android
# Make sure Unity isn't running while we switch directories out from under it.
if [ "$(pidof Unity)" ]; then
echo "Please quit Unity first"
exit
fi
# Make sure there is no Library directory.
rm -rf Library
# Link Library to platform directory
PLATFORM_DIR="${1}Library"
if [ ! -d $PLATFORM_DIR ]; then
mkdir $PLATFORM_DIR
fi
ln -s $PLATFORM_DIR Library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment