-
-
Save wahedzaman/d0c84dc1e1aec4dcc27a08a71870f26d 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
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 | |
# --------------------------------------------------------------------- | |
# 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