Search code examples
iphoneios-simulatorfinder

How to determine which device & os version of simulator?


I get bunch of serial numbers when I explorer following.

 cd ~/Library/Developer/CoreSimulator/Devices/

enter image description here

I exactly know which simulator (for example iPhone 5 with iOS8.1) I've used to run my application. But sometimes, I find it difficult to explore simulators to check documents directory & other stuff. Everything is with serial number.

Is there a trick to explore simulators with ease like follows?

  • iPhone 5 with iOS 8.1
  • iPhone 6 Plus with iOS 8.1 etc.

Solution

  • Here is the shell script for above request.

    cd ~/Desktop
    mkdir Simulators_Shortcuts
    destination="`pwd`/Simulators_Shortcuts"
    cd $destination
    cd ~/Library/Developer/CoreSimulator/Devices/
    for d in *; do
        if [ -d $d ] ; then
            cd $d;
            deviceName=`/usr/libexec/PlistBuddy -c "print :deviceType" device.plist | sed -e 's/com.apple.CoreSimulator.SimDeviceType.//g'`
            osName=`/usr/libexec/PlistBuddy -c "print :runtime" device.plist | sed -e 's/com.apple.CoreSimulator.SimRuntime.//g'`
            linkName="$deviceName-$osName"
            currentPath=`pwd`
            ln -s $currentPath "$destination/$linkName"
            cd ..
        fi
    done
    
    cd $destination
    

    Here is the snap-shot of what is the output as folders.

    enter image description here