Skip to content

Commit e60b028

Browse files
committed
fix: windows dll not found
1 parent 78eebe8 commit e60b028

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

script/adb.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ await $`curl -Lk ${downloadUrl} > ${platformToolsPath}`
1919
await $`unzip -o ${platformToolsPath} -d ${adbDir}`
2020
await fs.remove(platformToolsPath)
2121

22-
const file = isWindows ? 'adb.exe' : 'adb'
23-
await fs.copy(resolve(platformToolsDir, file), resolve(adbDir, file))
22+
let files = ['adb']
23+
if (isWindows) {
24+
files = ['adb.exe', 'AdbWinApi.dll', 'AdbWinUsbApi.dll']
25+
}
26+
for (let i = 0, len = files.length; i < len; i++) {
27+
const file = files[i]
28+
await fs.copy(resolve(platformToolsDir, file), resolve(adbDir, file))
29+
}
2430

2531
await fs.remove(platformToolsDir)
2632

0 commit comments

Comments
 (0)