Skip to content

Instantly share code, notes, and snippets.

@DominikBucher12
Created September 14, 2018 10:47

Revisions

  1. DominikBucher12 created this gist Sep 14, 2018.
    15 changes: 15 additions & 0 deletions create_latest_iOS_devices.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash

    # Create landscape devices

    # You should run this script everytime you install new Xcode with updated iOS version, because Xcode automatically deletes the older custom created simulators.

    # This just works, we need to find better solution to get the runtime. I think this should do for a while.
    runtime=$(xcrun simctl list runtimes | grep "iOS" | tail -1 | awk -F' - ' '{print $3F}')

    echo $runtime
    xcrun simctl create "iPad Air 2 (Landscape)" com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 $runtime
    xcrun simctl create "iPad Pro (10.5-inch) (Landscape)" com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch- $runtime
    xcrun simctl create "iPad Pro (12.9-inch) (Landscape)" com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation- $runtime

    # The other devices are not necessary to add, because they are packed up with Xcode itself and always update at latest version of iOS.