Blog

iOS: Retain Your Sanity With CoreSimulator Folders

Written by Metal Toad Staff | Sep 21, 2015 12:00:00 AM

Previously, we published a script to work around the opaque iOS Simulator folder structure on Xcode 6. With the recent release of Xcode 7, the naming structure changed a bit, so we've updated the script below:

#!/bin/sh
 
if [ -d $HOME/Documents/iOS\ Simulator\ Symlinks ]; then
  rm -rf ~/Documents/iOS\ Simulator\ Symlinks
fi
 
mkdir ~/Documents/iOS\ Simulator\ Symlinks
 
xcrun instruments -s | grep '\[[0-9A-F\-]*\]' | while read -r line ; do
    left=`echo $line | sed -n 's/ \[.*\]//p'`
    left=`echo $left | sed -n 's/ /\\ /pg'`
    right=`echo $line | sed -n 's/.*\[\(.*\)\]/\1/p'`
    ln -s ~/Library/Developer/CoreSimulator/Devices/"$right" ~/Documents/iOS\ Simulator\ Symlinks/"$left"
done