def METHOD_NAME(self, cmd: str) -> Optional[bytes]:
    """ run adb exec command """
    logger.debug(f'command: {cmd}')
    error_limit = 3
    while True:
        try:
            resp = self.session().exec(cmd)
            break
        except (socket.timeout, ConnectionRefusedError, RuntimeError) as e:
            if error_limit > 0:
                error_limit -= 1
                self.__exec('kill-server')
                self.__exec('start-server')
                time.sleep(10)
                self.__init_device()
                continue
            raise e
    if len(resp) <= 256:
        logger.debug(f'response: {repr(resp)}')
    return resp