private void Disconnect() { if (Scrcpy != null) { Scrcpy.Stop(); IsConnected = false; Scrcpy = null; } }
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(); }
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; }
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 }); }
private void Awake() { instance = this; adbController = new AdbController(); }