Listing Simulators Sanely
- Requires
jq
command line utility to manipulate JSON --brew install jq
or get it from their site
Filter Devices: Only iOS/tvOS/watchOS
xcrun simctl list devices -j | jq '.devices | to_entries | map(select(.key | startswith("iOS"))) | from_entries'
xcrun simctl list devices -j | jq '.devices | to_entries | map(select(.key | startswith("watchOS"))) | from_entries'
xcrun simctl list devices -j | jq '.devices | to_entries | map(select(.key | startswith("tvOS"))) | from_entries'
Filter Devices: All UDIDs (limited to a single platform)
xcrun simctl list devices -j | '.devices | to_entries | map(select(.key | startswith("iOS"))) | .[].value[].udid'
xcrun simctl list devices -j | '.devices | to_entries | map(select(.key | startswith("iOS"))) | .[] | .key, .value[].udid'
# Sample Output:
"iOS 9.3"
"3155E1C5-EAAB-4FC3-B517-F0B6DB066C2A"
"iOS 11.2"
"E492A9D3-3723-4308-AEF8-415CB3D37173"
"415FA8EA-0C84-4D0A-B930-2A88653AA7E0"
"31476627-3313-4533-8525-E6F859FB4805"
"B2293536-280A-46A8-A198-675EBE19A218"
List all device types
xcrun simctl list devicetypes -j | jq '.devicetypes[].name'