def GetSupportedSimOsVersions(os_type=ios_constants.OS.IOS):
    'Gets the supported version of given simulator OS type.\n\n  Args:\n    os_type: shared.ios_constants.OS, OS type of simulator, such as iOS,\n      watchOS, tvOS.\n\n  Returns:\n    a list of string, each item is an OS version number. E.g., ["10.1", "11.0"]\n  '
    if (os_type is None):
        os_type = ios_constants.OS.IOS
    xcode_version_num = xcode_info_util.GetXcodeVersionNumber()
    sim_runtime_infos_json = json.loads(RunSimctlCommand(('xcrun', 'simctl', 'list', 'runtimes', '-j')))
    sim_versions = []
    for sim_runtime_info in sim_runtime_infos_json['runtimes']:
        if (('availability' in sim_runtime_info) and (sim_runtime_info['availability'].find('unavailable') >= 0)):
            continue
        elif (('isAvailable' in sim_runtime_info) and (not sim_runtime_info['isAvailable'])):
            continue
        (listed_os_type, listed_os_version) = sim_runtime_info['name'].split(' ', 1)
        if (listed_os_type == os_type):
            if ('bundlePath' in sim_runtime_info):
                runtime_path = sim_runtime_info['bundlePath']
                info_plist_object = plist_util.Plist(os.path.join(runtime_path, 'Contents/Info.plist'))
                min_xcode_version_num = int(info_plist_object.GetPlistField('DTXcode'))
                if (xcode_version_num >= min_xcode_version_num):
                    sim_versions.append(listed_os_version)
            else:
                if (os_type == ios_constants.OS.IOS):
                    (ios_major_version, ios_minor_version) = listed_os_version.split('.', 1)
                    ios_minor_version = ios_minor_version[0]
                    ios_version_num = ((int(ios_major_version) * 100) + (int(ios_minor_version) * 10))
                    if (ios_version_num > (xcode_version_num + 200)):
                        continue
                sim_versions.append(listed_os_version)
    return sim_versions
Gets the supported version of given simulator OS type.

Args:
  os_type: shared.ios_constants.OS, OS type of simulator, such as iOS,
    watchOS, tvOS.

Returns:
  a list of string, each item is an OS version number. E.g., ["10.1", "11.0"]
def GetSupportedSimOsVersions(os_type=ios_constants.OS.IOS):
    'Gets the supported version of given simulator OS type.\n\n  Args:\n    os_type: shared.ios_constants.OS, OS type of simulator, such as iOS,\n      watchOS, tvOS.\n\n  Returns:\n    a list of string, each item is an OS version number. E.g., ["10.1", "11.0"]\n  '
    if (os_type is None):
        os_type = ios_constants.OS.IOS
    xcode_version_num = xcode_info_util.GetXcodeVersionNumber()
    sim_runtime_infos_json = json.loads(RunSimctlCommand(('xcrun', 'simctl', 'list', 'runtimes', '-j')))
    sim_versions = []
    for sim_runtime_info in sim_runtime_infos_json['runtimes']:
        if (('availability' in sim_runtime_info) and (sim_runtime_info['availability'].find('unavailable') >= 0)):
            continue
        elif (('isAvailable' in sim_runtime_info) and (not sim_runtime_info['isAvailable'])):
            continue
        (listed_os_type, listed_os_version) = sim_runtime_info['name'].split(' ', 1)
        if (listed_os_type == os_type):
            if ('bundlePath' in sim_runtime_info):
                runtime_path = sim_runtime_info['bundlePath']
                info_plist_object = plist_util.Plist(os.path.join(runtime_path, 'Contents/Info.plist'))
                min_xcode_version_num = int(info_plist_object.GetPlistField('DTXcode'))
                if (xcode_version_num >= min_xcode_version_num):
                    sim_versions.append(listed_os_version)
            else:
                if (os_type == ios_constants.OS.IOS):
                    (ios_major_version, ios_minor_version) = listed_os_version.split('.', 1)
                    ios_minor_version = ios_minor_version[0]
                    ios_version_num = ((int(ios_major_version) * 100) + (int(ios_minor_version) * 10))
                    if (ios_version_num > (xcode_version_num + 200)):
                        continue
                sim_versions.append(listed_os_version)
    return sim_versions