Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekstosio committed Nov 19, 2024
1 parent bfa2d8c commit ed8394b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/vscode-extension/src/devices/AndroidEmulatorDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ export class AndroidEmulatorDevice extends DeviceBase {
}

async mirrorNativeLogs(build: AndroidBuildResult) {
const extractPidFromLogcat = async () => new Promise<string>(async (resolve, reject) => {
const extractPidFromLogcat = async () =>
new Promise<string>(async (resolve, reject) => {
const regexString = `Start proc ([0-9]{4}):${build.packageName}`;
const process = exec(ADB_PATH, ["logcat", "-e", regexString]);
this.nativeLogsCancelToken.adapt(process);
Expand All @@ -400,15 +401,18 @@ export class AndroidEmulatorDevice extends DeviceBase {
}
});

// We should be able to get pid immediately, if we're not getting it in 2s, then we reject to not block the app.
// We should be able to get pid immediately, if we're not getting it in 2s, then we reject to not block the app.
setTimeout(() => {
process.kill();
reject(new Error("Timeout while waiting for app to start to get the process PID."));
}, 2000);
});

if (!this.nativeLogsOutputChannel) {
this.nativeLogsOutputChannel = window.createOutputChannel("Radon IDE (Android Emulator Logs)", 'log');
this.nativeLogsOutputChannel = window.createOutputChannel(
"Radon IDE (Android Emulator Logs)",
"log"
);
}

this.nativeLogsOutputChannel.clear();
Expand All @@ -426,7 +430,7 @@ export class AndroidEmulatorDevice extends DeviceBase {
// terminate the app before launching, otherwise launch commands won't actually start the process which
// may be in a bad state
await exec(ADB_PATH, ["-s", this.serial!, "shell", "am", "force-stop", build.packageName]);

this.mirrorNativeLogs(build);

const deepLinkChoice =
Expand Down

0 comments on commit ed8394b

Please sign in to comment.