def ip(self):
        """Returns the IP address of the host connected to the iOS phone.

        It is not the IP address of the iOS phone.
        If you want to get the IP address of the phone, you can access the interface `get_ip_address`.
        For example: when the device is connected via http://localhost:8100, return localhost.
        If it is a remote device http://192.168.xx.xx:8100, it returns the IP address of 192.168.xx.xx.

        Returns:
            IP.
        """
        match = re.search(IP_PATTERN, self.addr)
        if match:
            ip = match.group(0)
        else:
            ip = 'localhost'
        return ip
Returns the IP address of the host connected to the iOS phone.

        It is not the IP address of the iOS phone.
        If you want to get the IP address of the phone, you can access the interface `get_ip_address`.
        For example: when the device is connected via http://localhost:8100, return localhost.
        If it is a remote device http://192.168.xx.xx:8100, it returns the IP address of 192.168.xx.xx.

        Returns:
            IP.
        
airtest/core/ios/ios.py