def GetOsType(device_type):
    'Gets the OS type of the given simulator.\n\n  This method can not work fine if the device_type is invalid. Please calls\n  simulator_util.ValidateSimulatorType(device_type, os_version) to validate\n  it first.\n\n  Args:\n    device_type: string, device type of the new simulator. The value corresponds\n      to the output of `xcrun simctl list devicetypes`. E.g., iPhone 6, iPad\n      Air, etc.\n\n  Returns:\n    shared.ios_constants.OS.\n\n  Raises:\n    ios_errors.IllegalArgumentError: when the OS type of the given simulator\n        device type can not be recognized.\n  '
    if device_type.startswith('i'):
        return ios_constants.OS.IOS
    if ('TV' in device_type):
        return ios_constants.OS.TVOS
    if ('Watch' in device_type):
        return ios_constants.OS.WATCHOS
    raise ios_errors.IllegalArgumentError(('Failed to recognize the os type for simulator device type %s.' % device_type))
Gets the OS type of the given simulator.

This method can not work fine if the device_type is invalid. Please calls
simulator_util.ValidateSimulatorType(device_type, os_version) to validate
it first.

Args:
  device_type: string, device type of the new simulator. The value corresponds
    to the output of `xcrun simctl list devicetypes`. E.g., iPhone 6, iPad
    Air, etc.

Returns:
  shared.ios_constants.OS.

Raises:
  ios_errors.IllegalArgumentError: when the OS type of the given simulator
      device type can not be recognized.
def GetOsType(device_type):
    'Gets the OS type of the given simulator.\n\n  This method can not work fine if the device_type is invalid. Please calls\n  simulator_util.ValidateSimulatorType(device_type, os_version) to validate\n  it first.\n\n  Args:\n    device_type: string, device type of the new simulator. The value corresponds\n      to the output of `xcrun simctl list devicetypes`. E.g., iPhone 6, iPad\n      Air, etc.\n\n  Returns:\n    shared.ios_constants.OS.\n\n  Raises:\n    ios_errors.IllegalArgumentError: when the OS type of the given simulator\n        device type can not be recognized.\n  '
    if device_type.startswith('i'):
        return ios_constants.OS.IOS
    if ('TV' in device_type):
        return ios_constants.OS.TVOS
    if ('Watch' in device_type):
        return ios_constants.OS.WATCHOS
    raise ios_errors.IllegalArgumentError(('Failed to recognize the os type for simulator device type %s.' % device_type))