Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 <hintoz@gmail.com>
#
# 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
You can’t perform that action at this time.