From 6add61c72c16782617090dff9fbe4809e704cabd Mon Sep 17 00:00:00 2001 From: Teages Date: Fri, 12 May 2023 16:08:28 +0800 Subject: [PATCH] fix adb when no adb.exe in path --- server/internal/adb/adb.go | 3 ++- server/internal/adb/adb_windows.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/internal/adb/adb.go b/server/internal/adb/adb.go index 3b909de..2495dfd 100644 --- a/server/internal/adb/adb.go +++ b/server/internal/adb/adb.go @@ -44,7 +44,8 @@ func Exec(args ...string) { func init() { Exec("start-server") a, err := adb.NewWithConfig(adb.ServerConfig{ - Port: *flag.Int("p", adb.AdbPort, ""), + PathToAdb: adbPath, + Port: *flag.Int("p", adb.AdbPort, ""), }) if logger.Catch(err) { logger.Error("Can't start ADB server") diff --git a/server/internal/adb/adb_windows.go b/server/internal/adb/adb_windows.go index 61df086..e410974 100644 --- a/server/internal/adb/adb_windows.go +++ b/server/internal/adb/adb_windows.go @@ -11,6 +11,6 @@ var ( adbFiles embed.FS adbPath = func() string { vfile.JoinPart("libs/adb", "windows", adbFiles) - return vfile.GetPath("libs/adb/adb") + return vfile.GetPath("libs/adb/adb.exe") }() )