Skip to content

Commit

Permalink
Merge pull request #457 from PhoenixWyllow/bugfix/adb
Browse files Browse the repository at this point in the history
fix adb client error: address is not valid
  • Loading branch information
manuelmayer-dev authored Oct 14, 2023
2 parents 51f54e5 + ab8c3ca commit 2b953fd
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 2b953fd

Please sign in to comment.