Пример #1
0
 private void Disconnect()
 {
     if (Scrcpy != null)
     {
         Scrcpy.Stop();
         IsConnected = false;
         Scrcpy      = null;
     }
 }
Пример #2
0
        public void TestMethod1()
        {
            var adb    = new AdbClient();
            var device = adb.GetDevices().FirstOrDefault();

            if (device == null)
            {
                Assert.Inconclusive("No device connected.");
                return;
            }

            var adc = new Scrcpy(device);

            adc.Start();
        }
Пример #3
0
        private void Connect(DeviceData device)
        {
            if (device == null)
            {
                return;
            }
            if (Scrcpy != null)
            {
                throw new Exception("Already connected.");
            }

            Scrcpy         = new Scrcpy(device);
            Scrcpy.Bitrate = (long)(BitrateKb * 1000);
            Scrcpy.Start();
            DeviceName  = Scrcpy.DeviceName;
            IsConnected = true;
        }
Пример #4
0
        private void SendKeycode(AndroidKeycode key)
        {
            if (Scrcpy == null)
            {
                return;
            }

            Scrcpy.SendControlCommand(new KeycodeControlMessage
            {
                KeyCode = key,
                Action  = AndroidKeyEventAction.AKEY_EVENT_ACTION_DOWN
            });

            // No need to wait before sending the KeyUp event.

            Scrcpy.SendControlCommand(new KeycodeControlMessage
            {
                KeyCode = key,
                Action  = AndroidKeyEventAction.AKEY_EVENT_ACTION_UP
            });
        }
Пример #5
0
 private void Awake()
 {
     instance      = this;
     adbController = new AdbController();
 }