def get_frames(self):
        """
        rotation is alwary right on iOS
        """
        s = SafeSocket()
        s.connect(("localhost", self.port))
        t = s.recv(24)
        # minicap info
        print(struct.unpack("<2B5I2B", t))

        while True:
            # recv header, count frame_size
            if self.CAPTIMEOUT is not None:
                header = s.recv_with_timeout(4, self.CAPTIMEOUT)
            else:
                header = s.recv(4)
            if header is None:
                LOGGING.error("minicap header is None")
                # recv timeout, if not frame updated, maybe screen locked
                yield None
            else:
                frame_size = struct.unpack("<I", header)[0]
                # recv image data
                one_frame = s.recv(frame_size)
                yield one_frame
        s.close()

        rotation is alwary right on iOS
        
airtest/core/ios/minicap.py