Skip to content

Pass wait for debugger option. Handle simulator output so that we cou… #1047

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

Merged
merged 3 commits into from
Oct 12, 2015
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/common
16 changes: 15 additions & 1 deletion lib/services/ios-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<void>()();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down