Skip to content

Commit e329792

Browse files
committed
enable v8-inspector support
1 parent 6a2685e commit e329792

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/services/android-debug-service.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ class AndroidDebugService implements IDebugService {
7878
let port = -1;
7979
let forwardsResult = this.device.adb.executeCommand(["forward", "--list"]).wait();
8080

81+
let unixSocketName = `${packageName}-inspectorServer`;
82+
8183
//matches 123a188909e6czzc tcp:40001 localabstract:org.nativescript.testUnixSockets-debug
82-
let regexp = new RegExp(`(?:${deviceId} tcp:)([\\d]+)(?= localabstract:${packageName}-debug)`, "g");
84+
let regexp = new RegExp(`(?:${deviceId} tcp:)([\\d]+)(?= localabstract:${unixSocketName})`, "g");
8385
let match = regexp.exec(forwardsResult);
8486
if (match) {
8587
port = parseInt(match[1]);
@@ -92,7 +94,7 @@ class AndroidDebugService implements IDebugService {
9294
}
9395
port = candidatePort;
9496

95-
this.unixSocketForward(port, packageName + "-debug").wait();
97+
this.unixSocketForward(port, `${unixSocketName}`).wait();
9698
}
9799

98100
return port;
@@ -159,7 +161,7 @@ class AndroidDebugService implements IDebugService {
159161
if (this.$options.client) {
160162
let port = this.getForwardedLocalDebugPortForPackageName(deviceId, packageName).wait();
161163
this.startDebuggerClient(port).wait();
162-
this.openDebuggerClient(AndroidDebugService.DEFAULT_NODE_INSPECTOR_URL + "?port=" + port);
164+
//this.openDebuggerClient(AndroidDebugService.DEFAULT_NODE_INSPECTOR_URL + "?port=" + port);
163165
}
164166
}).future<void>()();
165167
}
@@ -238,11 +240,12 @@ class AndroidDebugService implements IDebugService {
238240

239241
private startDebuggerClient(port: Number): IFuture<void> {
240242
return (() => {
241-
let nodeInspectorModuleFilePath = require.resolve("node-inspector");
242-
let nodeInspectorModuleDir = path.dirname(nodeInspectorModuleFilePath);
243-
let nodeInspectorFullPath = path.join(nodeInspectorModuleDir, "bin", "inspector");
244-
this._debuggerClientProcess = this.$childProcess.spawn(process.argv[0], [nodeInspectorFullPath, "--debug-port", port.toString()], { stdio: "ignore", detached: true });
245-
this.$processService.attachToProcessExitSignals(this, this.debugStop);
243+
//let nodeInspectorModuleFilePath = require.resolve("node-inspector");
244+
//let nodeInspectorModuleDir = path.dirname(nodeInspectorModuleFilePath);
245+
//let nodeInspectorFullPath = path.join(nodeInspectorModuleDir, "bin", "inspector");
246+
//this._debuggerClientProcess = this.$childProcess.spawn(process.argv[0], [nodeInspectorFullPath, "--debug-port", port.toString()], { stdio: "ignore", detached: true });
247+
//this.$processService.attachToProcessExitSignals(this, this.debugStop);
248+
this.$logger.info(`To start debugging, open the following URL in Chrome:\nchrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:${port}\n`);
246249
}).future<void>()();
247250
}
248251

0 commit comments

Comments
 (0)