def get_devices() -> _List[Device]:
        """
        Retrieve a list of all available devices connected to the host.

        This method uses the 'xcrun devicectl' command-line tool to fetch information
        about all connected devices and parses the result to create Device objects.

        Returns
        -------
        List[Device]
            A list of Device objects, each representing a connected device.
            Each Device object typically contains:
            - name: The name of the device.
            - identifier: A unique identifier for the device.
            - os_version: The operating system version of the device.
            - os_build_number: The build number of the operating system.
            - developer_mode_state: The state of developer mode on the device.
            - type: The type of the device (e.g., iPhone, iPad, Mac).
            - state: The current state of the device (e.g., connected, available).
            - udid: The Unique Device Identifier.
        """
        json_data = _DeviceCtl._run_command("xcrun devicectl list devices")
        result = json_data.get("result", None)
        if result is None:
            raise _DeviceCtlError("No 'result' field in the JSON data")

        devices = result.get("devices", None)
        if not isinstance(devices, _Sequence):
            raise _DeviceCtlError("No 'devices' field in the JSON data")

        result: _List[Device] = []

        for device in devices:
            device_properties = device.get("deviceProperties", {})
            hardware_properties = device.get("hardwareProperties", {})
            connection_properties = device.get("connectionProperties", {})

            if not isinstance(device_properties, _Mapping):
                raise _DeviceCtlError("No 'deviceProperties' field in the JSON data")

            if not isinstance(hardware_properties, _Mapping):
                raise _DeviceCtlError("No 'hardwareProperties' field in the JSON data")

            if not isinstance(connection_properties, _Mapping):
                raise _DeviceCtlError("No 'connectionProperties' field in the JSON data")

            type = DeviceType.UNKNOWN
            identifier = device.get("identifier", "")
            type = DeviceType(hardware_properties.get("deviceType", "").lower())
            udid = hardware_properties.get("udid", "")

            name = device_properties.get("name", "")
            if (
                len(identifier) == 0
                or len(udid) == 0
                or len(name) == 0
                or type == DeviceType.UNKNOWN
            ):
                _logger.warning(
                    f"Missing device identifier={identifier} or udid={udid} or type={type}, skipping."
                )
                continue

            os_version = device_properties.get("osVersionNumber", "")
            os_build_number = device_properties.get("osBuildUpdate", "")
            developer_mode_state = device_properties.get("developerModeStatus", "")
            state = DeviceState.UNKNOWN
            tunnel_state = connection_properties.get("tunnelState", DeviceState.UNKNOWN.value)
            state = DeviceState(tunnel_state.lower())
            device = Device(
                name=name,
                identifier=identifier,
                os_version=os_version,
                os_build_number=os_build_number,
                developer_mode_state=developer_mode_state,
                type=type,
                state=state,
                udid=udid,
                session=None,
            )
            result.append(device)

        return result

        Retrieve a list of all available devices connected to the host.

        This method uses the 'xcrun devicectl' command-line tool to fetch information
        about all connected devices and parses the result to create Device objects.

        Returns
        -------
        List[Device]
            A list of Device objects, each representing a connected device.
            Each Device object typically contains:
            - name: The name of the device.
            - identifier: A unique identifier for the device.
            - os_version: The operating system version of the device.
            - os_build_number: The build number of the operating system.
            - developer_mode_state: The state of developer mode on the device.
            - type: The type of the device (e.g., iPhone, iPad, Mac).
            - state: The current state of the device (e.g., connected, available).
            - udid: The Unique Device Identifier.
        
coremltools/models/ml_program/experimental/remote_device.py