Add one more fallback for the adb path

Summary: It seems that adb path has changed on the jest-e2e side. That might case the flipper e2e test failure. With this fallback we have granular control of the path.

Reviewed By: antonk52

Differential Revision: D46278512

fbshipit-source-id: 97310459de54eeb003eefb3a3ff06af8b13bebae
This commit is contained in:
Andrey Goncharov
2023-05-30 09:47:19 -07:00
committed by Facebook GitHub Bot
parent ff6b0043c4
commit 53a5939d68

View File

@@ -51,11 +51,19 @@ async function startAdbServer(androidHome: string) {
const adbPath = path.resolve(androidHome, 'platform-tools', 'adb');
const args = ['start-server'];
return execFile(adbPath, args).catch((error) => {
return execFile(adbPath, args)
.catch((error) => {
if (error.code == 'ENOENT') {
console.info('falling back to the alternative adb path');
return execFile(path.resolve(androidHome, 'adb'), args);
}
throw error;
})
.catch((error) => {
if (error.code == 'ENOENT') {
console.info('falling back to the adb path of last resort');
return execFile(androidHome, args);
}
throw error;
});