Skip to content

Commit

Permalink
fix adb client error: address is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixWyllow committed Oct 14, 2023
1 parent 51f54e5 commit ab8c3ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MacroDeck/Server/ADBServerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class AdbDeviceConnectionStateChangedEventArgs : EventArgs
public class ADBServerHelper
{

private static AdbServer? _adbServer;
private static IAdbServer? _adbServer;

private static AdbClient? _adbClient;
private static IAdbClient? _adbClient;

private static string _adbFolderName = "Android Debug Bridge";

Expand Down Expand Up @@ -59,15 +59,15 @@ public static void Initialize()
}

MacroDeckLogger.Info(typeof(ADBServerHelper), $"Starting ADB server using {_adbPath}");
_adbServer = new AdbServer();

_adbClient = new AdbClient();
_adbServer = new AdbServer(_adbClient, Factories.AdbCommandLineClientFactory);
var result = _adbServer.StartServer(_adbPath, true);
if (result != StartServerResult.Started)
{
MacroDeckLogger.Info(typeof(ADBServerHelper), "Unable to start ADB server");
}

_adbClient = new AdbClient();

Task.Run(() =>
{
var monitor = new DeviceMonitor(new AdbSocket(new IPEndPoint(IPAddress.Loopback, AdbClient.AdbServerPort)));
Expand Down

0 comments on commit ab8c3ca

Please sign in to comment.