Skip to content

Commit c363ccf

Browse files
committed
iOS runtime should provide an application that would be used to visualize the updated web inspector frontend. So open the application instead of Safari, because Safari is not able to render the frontend properly
1 parent 74a647e commit c363ccf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/services/ios-debug-service.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import stream = require("stream");
66
import path = require("path");
77
import http = require("http");
88
import Future = require("fibers/future");
9+
import util = require("util");
910

1011
module notification {
1112
function formatNotification(bundleId: string, notification: string) {
@@ -204,12 +205,15 @@ class IOSDebugService implements IDebugService {
204205

205206
private openDebuggingClient(): IFuture<void> {
206207
return (() => {
207-
var cmd = "open -a Safari " + this.getSafariPath().wait();
208+
var inspectorPath = this.getInspectorPath().wait();
209+
var inspectorApplicationPath = path.join(inspectorPath, "NativeScript Inspector.app");
210+
var inspectorSourceLocation = path.join(inspectorPath, "Safari/Main.html");
211+
var cmd = util.format("open -a '%s' --args '%s' '%s'", inspectorApplicationPath, inspectorSourceLocation, this.$projectData.projectName);
208212
this.$childProcess.exec(cmd).wait();
209213
}).future<void>()();
210214
}
211215

212-
private getSafariPath(): IFuture<string> {
216+
private getInspectorPath(): IFuture<string> {
213217
return (() => {
214218
var tnsIosPackage = "";
215219
if (this.$options.frameworkPath) {
@@ -221,8 +225,8 @@ class IOSDebugService implements IDebugService {
221225
var platformData = this.$platformsData.getPlatformData(this.platform);
222226
tnsIosPackage = this.$npmInstallationManager.install(platformData.frameworkPackageName).wait();
223227
}
224-
var safariPath = path.join(tnsIosPackage, "WebInspectorUI/Safari/Main.html");
225-
return safariPath;
228+
var inspectorPath = path.join(tnsIosPackage, "WebInspectorUI/");
229+
return inspectorPath;
226230
}).future<string>()();
227231
}
228232
}

0 commit comments

Comments
 (0)