def setup_server(self):
        """
        Setup maxtouch server and adb forward

        Returns:
            server process

        """
        if self.server_proc:
            self.server_proc.kill()
            self.server_proc = None

        self.localport, deviceport = self.adb.setup_forward("localabstract:maxpresent_{}".format)
        deviceport = deviceport[len("localabstract:"):]
        p = self.adb.start_shell("app_process -Djava.class.path={0} /data/local/tmp com.netease.maxpresent.MaxPresent socket {1}".format(self.path_in_android, deviceport))

        nbsp = NonBlockingStreamReader(p.stdout, name="airtouch_server", auto_kill=True)
        line = nbsp.readline(timeout=5.0)
        if line is None:
            kill_proc(p)
            raise RuntimeError("airtouch setup timeout")

        if p.poll() is not None:
            # server setup error, may be already setup by others
            # subprocess exit immediately
            kill_proc(p)
            raise RuntimeError("airtouch server quit immediately")
        self.server_proc = p
        return p

        Setup maxtouch server and adb forward

        Returns:
            server process

        
airtest/core/android/touch_methods/maxtouch.py