def list_app(udid, app_type="user"):
        """
        Returns a list of installed applications on the device.

        Args:
            udid (str): The unique identifier of the device.
            app_type (str, optional): The type of applications to list. Defaults to "user".
                Possible values are "user", "system", or "all".

        Returns:
            list: A list of tuples containing the bundle ID, display name,
                and version of the installed applications.
            e.g. [('com.apple.mobilesafari', 'Safari', '8.0'), ...]
        """
        app_type = {
            "user": "User",
            "system": "System",
            "all": None,
        }.get(app_type.lower(), None)
        app_list = []
        for info in BaseDevice(udid, Usbmux()).installation.iter_installed(app_type=app_type):
            bundle_id = info['CFBundleIdentifier']
            try:
                display_name = info['CFBundleDisplayName']
                version = info.get('CFBundleShortVersionString', '')
                app_list.append((bundle_id, display_name, version))
            except BrokenPipeError:
                break
        return app_list

        Returns a list of installed applications on the device.

        Args:
            udid (str): The unique identifier of the device.
            app_type (str, optional): The type of applications to list. Defaults to "user".
                Possible values are "user", "system", or "all".

        Returns:
            list: A list of tuples containing the bundle ID, display name,
                and version of the installed applications.
            e.g. [('com.apple.mobilesafari', 'Safari', '8.0'), ...]
        
airtest/core/ios/ios.py