diff --git a/lib/common b/lib/common index 649967a2f1..7f0774504c 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 649967a2f1732f7bc710fd59cf617b6603dc7b1c +Subproject commit 7f0774504c7660c1444ae204c00cf3b7c908292c diff --git a/lib/services/ios-debug-service.ts b/lib/services/ios-debug-service.ts index cb6fdad1f5..30988f3711 100644 --- a/lib/services/ios-debug-service.ts +++ b/lib/services/ios-debug-service.ts @@ -10,6 +10,7 @@ import * as path from "path"; import Future = require("fibers/future"); import semver = require("semver"); import temp = require("temp"); +import byline = require("byline"); module notification { function formatNotification(bundleId: string, notification: string) { @@ -118,7 +119,20 @@ class IOSDebugService implements IDebugService { this.$platformService.buildPlatform(this.platform).wait(); let emulatorPackage = this.$platformService.getLatestApplicationPackageForEmulator(platformData).wait(); - this.$iOSEmulatorServices.startEmulator(emulatorPackage.packageName, { args: "--nativescript-debug-brk" }).wait(); + let child_process = this.$iOSEmulatorServices.startEmulator(emulatorPackage.packageName, { waitForDebugger: true, captureStdin: true, args: "--nativescript-debug-brk" }).wait(); + let lineStream = byline(child_process.stdout); + + lineStream.on('data', (line: NodeBuffer) => { + let lineText = line.toString(); + if(lineText && _.startsWith(lineText, emulatorPackage.packageName)) { + let pid = _.trimLeft(lineText, emulatorPackage.packageName + ": "); + + this.$childProcess.exec(`lldb -p ${pid} -o "process continue"`); + } else { + process.stdout.write(line + "\n"); + } + }); + this.wireDebuggerClient(() => net.connect(InspectorBackendPort)).wait(); }).future()(); } diff --git a/package.json b/package.json index 6f364a47b9..8e491d8dcc 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "gulp": "3.9.0", "iconv-lite": "0.4.11", "inquirer": "0.9.0", - "ios-sim-portable": "1.0.9-beta", + "ios-sim-portable": "1.0.10-alpha", "lockfile": "1.0.1", "lodash": "3.10.0", "log4js": "0.6.26",