#!/usr/bin/env bash # # Based on original solution by user lembacon, here: # https://forums.developer.apple.com/thread/13170?start=105&tstart=0 # Watch fix added by user Richie__. # # Created by Clay Bridges, 5 Aug 2015 move_dyld_sim() { if [ -f dyld_sim ]; then sudo mv dyld_sim dyld_sim.orig else echo "ERROR: dyld_sim does not exist" exit 256 fi } APP=$1 if [ -e "$APP" ]; then echo "Fixing Xcode instance \"$APP\" for El Capitan beta 6" else echo "ERROR: first argument \"$APP\" must be a path to an Xcode app" echo "Usage: $0 " exit 256 fi PLATFORMS=$APP/Contents/Developer/Platforms IOS_LIB_DIR=$PLATFORMS/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib WATCH_LIB_DIR=$PLATFORMS/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/lib if [ -d "$IOS_LIB_DIR" ]; then cd $IOS_LIB_DIR move_dyld_sim echo "Fixed iPhoneSimulator" else printf "ERROR: could not find iOS Simulator directory:\n $IOS_LIB_DIR\n" exit 256 fi # I think this only applies to Xcode 7 if [ -d "$WATCH_LIB_DIR" ]; then cd $WATCH_LIB_DIR move_dyld_sim echo "Fixed WatchSimulator" fi