feat(android): fix custom adb path no effect

This commit is contained in:
HBLADEH 2025-05-06 15:36:32 +08:00
parent 2b502df712
commit f3cc70fdb8

View File

@ -52,13 +52,15 @@ export class AndroidDevice implements AndroidDevicePage {
try {
const androidAdbPath = getAIConfig(MIDSCENE_ADB_PATH);
this.adb = await ADB.createADB({
// If `androidAdbPath` exists, use `newADB()`
this.adb = androidAdbPath ? this.adb = await new ADB({
udid: this.deviceId,
adbExecTimeout: 60000,
executable: androidAdbPath
? { path: androidAdbPath, defaultArgs: [] }
: undefined,
});
executable: { path: androidAdbPath, defaultArgs: [] }
}) : await ADB.createADB({
udid: this.deviceId,
adbExecTimeout: 60000,
})
const size = await this.getScreenSize();
console.log(`