Skip to content

Commit ac6e475

Browse files
committed
Merge pull request #604 from NativeScript/KristinaKoeva/DebuggingFix
Open web inspector frontend in a standalone application instead of Safari
2 parents 012a406 + 29a7a97 commit ac6e475

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/services/ios-debug-service.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,15 @@ class IOSDebugService implements IDebugService {
204204

205205
private openDebuggingClient(): IFuture<void> {
206206
return (() => {
207-
var cmd = "open -a Safari " + this.getSafariPath().wait();
207+
let inspectorPath = this.getInspectorPath().wait();
208+
let inspectorApplicationPath = path.join(inspectorPath, "NativeScript Inspector.app");
209+
let inspectorSourceLocation = path.join(inspectorPath, "Safari/Main.html");
210+
let cmd = `open -a '${inspectorApplicationPath}' --args '${inspectorSourceLocation}' '${this.$projectData.projectName}'`;
208211
this.$childProcess.exec(cmd).wait();
209212
}).future<void>()();
210213
}
211214

212-
private getSafariPath(): IFuture<string> {
215+
private getInspectorPath(): IFuture<string> {
213216
return (() => {
214217
var tnsIosPackage = "";
215218
if (this.$options.frameworkPath) {
@@ -221,8 +224,8 @@ class IOSDebugService implements IDebugService {
221224
var platformData = this.$platformsData.getPlatformData(this.platform);
222225
tnsIosPackage = this.$npmInstallationManager.install(platformData.frameworkPackageName).wait();
223226
}
224-
var safariPath = path.join(tnsIosPackage, "WebInspectorUI/Safari/Main.html");
225-
return safariPath;
227+
var inspectorPath = path.join(tnsIosPackage, "WebInspectorUI/");
228+
return inspectorPath;
226229
}).future<string>()();
227230
}
228231
}

0 commit comments

Comments
 (0)