Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not call 'start-server' if the 'suppressKillServer' option is enabled #725

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/adb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import log from './logger';
import type {ADBOptions, ADBExecutable} from './options';
import type { LogcatOpts } from './logcat';
import type { LRUCache } from 'lru-cache';
import type { ExecError } from 'teen_process';

const DEFAULT_ADB_PORT = 5037;
export const DEFAULT_OPTS = {
Expand Down Expand Up @@ -81,11 +82,13 @@ export class ADB {
const adb = new ADB(opts);
adb.sdkRoot = await requireSdkRoot(adb.sdkRoot);
await adb.getAdbWithCorrectAdbPath();
try {
await adb.adbExec(['start-server']);
} catch (e) {
const err = e as import('teen_process').ExecError;
log.warn(err.stderr || err.message);
if (!opts.suppressKillServer) {
try {
await adb.adbExec(['start-server']);
} catch (e) {
const err = e as ExecError;
log.warn(err.stderr || err.message);
}
}
return adb;
}
Expand Down
Loading