def ls(self, remote_path, bundle_id=None):
        """
        List files and directories in the specified remote path on the iOS device.

        Args:
            remote_path (str): The remote path to list.
            bundle_id (str, optional): The bundle ID of the app. Defaults to None. Required for remote devices.

        Returns:
            list: A list of files and directories in the remote path. Each item in the list is a dictionary with the following keys:
                - 'type': The type of the item. This can be 'Directory' or 'File'.
                - 'size': The size of the item in bytes.
                - 'last_modified': The last modification time of the item, in the format 'YYYY-MM-DD HH:MM:SS'.
                - 'name': The name of the item, including the path relative to `remote_path`.
            e.g.
            [
                {'type': 'Directory', 'size': 1024, 'last_modified': 'YYYY-MM-DD HH:MM:SS', 'name': 'example_directory/'},
                {'type': 'File', 'size': 2048, 'last_modified': 'YYYY-MM-DD HH:MM:SS', 'name': 'example_file.txt'}
            ]

        Raises:
            LocalDeviceError: If the device is remote.

        Examples:

            List files and directories in the DCIM directory::

                >>> dev = connect_device("iOS:///http+usbmux://udid")
                >>> print(dev.ls("/DCIM/"))
                [{'type': 'Directory', 'size': 96, 'last_modified': '2021-12-01 15:30:13', 'name': '100APPLE/'}, {'type': 'Directory', 'size': 96, 'last_modified': '2021-07-20 17:29:01', 'name': '.MISC/'}]

            List files and directories in the Documents directory of the Keynote app::

                >>> print(dev.ls("/Documents", "com.apple.Keynote"))
                [{'type': 'File', 'size': 302626, 'last_modified': '2024-06-25 11:25:25', 'name': 'test.key'}]

        """
        if not self.is_local_device:
            raise LocalDeviceError()
        return TIDevice.ls(self.udid, remote_path, bundle_id=bundle_id)

        List files and directories in the specified remote path on the iOS device.

        Args:
            remote_path (str): The remote path to list.
            bundle_id (str, optional): The bundle ID of the app. Defaults to None. Required for remote devices.

        Returns:
            list: A list of files and directories in the remote path. Each item in the list is a dictionary with the following keys:
                - 'type': The type of the item. This can be 'Directory' or 'File'.
                - 'size': The size of the item in bytes.
                - 'last_modified': The last modification time of the item, in the format 'YYYY-MM-DD HH:MM:SS'.
                - 'name': The name of the item, including the path relative to `remote_path`.
            e.g.
            [
                {'type': 'Directory', 'size': 1024, 'last_modified': 'YYYY-MM-DD HH:MM:SS', 'name': 'example_directory/'},
                {'type': 'File', 'size': 2048, 'last_modified': 'YYYY-MM-DD HH:MM:SS', 'name': 'example_file.txt'}
            ]

        Raises:
            LocalDeviceError: If the device is remote.

        Examples:

            List files and directories in the DCIM directory::

                >>> dev = connect_device("iOS:///http+usbmux://udid")
                >>> print(dev.ls("/DCIM/"))
                [{'type': 'Directory', 'size': 96, 'last_modified': '2021-12-01 15:30:13', 'name': '100APPLE/'}, {'type': 'Directory', 'size': 96, 'last_modified': '2021-07-20 17:29:01', 'name': '.MISC/'}]

            List files and directories in the Documents directory of the Keynote app::

                >>> print(dev.ls("/Documents", "com.apple.Keynote"))
                [{'type': 'File', 'size': 302626, 'last_modified': '2024-06-25 11:25:25', 'name': 'test.key'}]

        
airtest/core/ios/ios.py