Skip to content

Instantly share code, notes, and snippets.

@hintoz
Last active April 24, 2019 12:50
Show Gist options
  • Save hintoz/e8d60a04890bd864b5a39574c0ee0729 to your computer and use it in GitHub Desktop.
Save hintoz/e8d60a04890bd864b5a39574c0ee0729 to your computer and use it in GitHub Desktop.
Creates a link for iOS, tvOS, and WatchOS beta from the Xcode beta to the release Xcode. #Xcode #XcodeBeta #iOSBeta
#!/bin/sh
# ---------------------------------------------------------------------
# Copyright (C) 2019 Evgeny Dats <[email protected]>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# ---------------------------------------------------------------------
XCODEPATH="/Applications/Xcode.app/Contents/Developer/Platforms/OSREPLACE/DeviceSupport/"
XCODEBETAPATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/OSREPLACE/DeviceSupport/"
IPHONEOS="iPhoneOS.platform"
APPLETVOS="AppleTVOS.platform"
WATCHOS="WatchOS.platform"
ARRAY=($IPHONEOS $APPLETVOS $WATCHOS)
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
for OS in ${ARRAY[@]}
do
XCODEBETA=${XCODEBETAPATH//'OSREPLACE'/$OS}
XCODE=${XCODEPATH//'OSREPLACE'/$OS}
cd $XCODEBETA
VER="$(ls -td -- */ | sort -t'.' -rn | head -n 1 | cut -d'/' -f1)"
sudo ln -s "$XCODEBETA${VER}" "$XCODE"
done
echo "Done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment