Skip to content

Instantly share code, notes, and snippets.

@DominikBucher12
Created September 14, 2018 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikBucher12/74994688de815e88971e253feb375f56 to your computer and use it in GitHub Desktop.
Save DominikBucher12/74994688de815e88971e253feb375f56 to your computer and use it in GitHub Desktop.
Simple script which installs latest version of simulators. Just list throught xcrun simctl list runtimes | devicetypes to see what fits for you. Modify as you wish.
#!/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment