Skip to content

Commit 92378b7

Browse files
FatmeFatme
authored andcommitted
Merge pull request #701 from NativeScript/fatme/open-correct-debugger-url
Open correct debugger url when framework version is lower than 1.2.0
2 parents e566aa6 + c797510 commit 92378b7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/services/ios-debug-service.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,14 @@ class IOSDebugService implements IDebugService {
218218

219219
private openDebuggingClient(): IFuture<void> {
220220
return (() => {
221-
let inspectorPath = this.getInspectorPath().wait();
222-
let inspectorSourceLocation = path.join(inspectorPath, "Safari/Main.html");
223-
let cmd: string = null;
224-
225221
this.$projectDataService.initialize(this.$projectData.projectDir);
226222
let platformData = this.$platformsData.getPlatformData(this.platform);
227223
let frameworkVersion = this.$projectDataService.getValue(platformData.frameworkPackageName).wait().version;
224+
225+
let inspectorPath = this.getInspectorPath(frameworkVersion).wait();
226+
let inspectorSourceLocation = path.join(inspectorPath, "Safari/Main.html");
227+
let cmd: string = null;
228+
228229
if(semver.lt(frameworkVersion, "1.2.0")) {
229230
cmd = `open -a Safari "${inspectorSourceLocation}"`;
230231
} else {
@@ -239,7 +240,7 @@ class IOSDebugService implements IDebugService {
239240
}).future<void>()();
240241
}
241242

242-
private getInspectorPath(): IFuture<string> {
243+
private getInspectorPath(frameworkVersion: string): IFuture<string> {
243244
return (() => {
244245
var tnsIosPackage = "";
245246
if (this.$options.frameworkPath) {
@@ -249,7 +250,7 @@ class IOSDebugService implements IDebugService {
249250
tnsIosPackage = path.resolve(this.$options.frameworkPath);
250251
} else {
251252
var platformData = this.$platformsData.getPlatformData(this.platform);
252-
tnsIosPackage = this.$npmInstallationManager.install(platformData.frameworkPackageName).wait();
253+
tnsIosPackage = this.$npmInstallationManager.install(platformData.frameworkPackageName, { version: frameworkVersion }).wait();
253254
}
254255
var inspectorPath = path.join(tnsIosPackage, "WebInspectorUI/");
255256
return inspectorPath;

0 commit comments

Comments
 (0)