Skip to content
Merged
Changes from all commits
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
15 changes: 13 additions & 2 deletions lib/services/ios-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,31 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
}

_.forEach(this._sockets, socket => socket.destroy());

this._sockets = [];

if (this._lldbProcess) {
this._lldbProcess.stdin.write("process detach\n");
this._lldbProcess.kill();

await this.killProcess(this._lldbProcess);
this._lldbProcess = undefined;
}

if (this._childProcess) {
this._childProcess.kill();
await this.killProcess(this._childProcess);
this._childProcess = undefined;
}
}

private async killProcess(childProcess: ChildProcess): Promise<void> {
if (childProcess) {
return new Promise<void>((resolve, reject) => {
childProcess.on("close", resolve);
childProcess.kill();
});
}
}

private async emulatorDebugBrk(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
let args = debugOptions.debugBrk ? "--nativescript-debug-brk" : "--nativescript-debug-start";
let child_process = await this.$iOSEmulatorServices.runApplicationOnEmulator(debugData.pathToAppPackage, {
Expand Down