From 5820370bf919233cfb652c4664dce4dcb7a7ce56 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Thu, 14 Jul 2016 18:36:39 +0300 Subject: [PATCH] Added support for debug with livesync --- lib/definitions/debug.d.ts | 2 +- lib/services/ios-debug-service.ts | 5 +++-- lib/services/livesync/ios-livesync-service.ts | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/definitions/debug.d.ts b/lib/definitions/debug.d.ts index 837f9f3863..23873571cb 100644 --- a/lib/definitions/debug.d.ts +++ b/lib/definitions/debug.d.ts @@ -1,5 +1,5 @@ interface IDebugService { - debug(): IFuture; + debug(shouldBreak?: boolean): IFuture; debugStart(): IFuture; platform: string; } \ No newline at end of file diff --git a/lib/services/ios-debug-service.ts b/lib/services/ios-debug-service.ts index 0f33fcb35b..10c25872e2 100644 --- a/lib/services/ios-debug-service.ts +++ b/lib/services/ios-debug-service.ts @@ -60,7 +60,6 @@ class IOSDebugService implements IDebugService { } else { let deploy = this.$platformService.deployOnDevice(this.platform); deploy.wait(); - return this.deviceStart(); } } @@ -76,7 +75,9 @@ class IOSDebugService implements IDebugService { private emulatorDebugBrk(shouldBreak?: boolean): IFuture { return (() => { let platformData = this.$platformsData.getPlatformData(this.platform); - this.$platformService.buildPlatform(this.platform).wait(); + if (!this.$options.debug) { + this.$platformService.buildPlatform(this.platform).wait(); + } let emulatorPackage = this.$platformService.getLatestApplicationPackageForEmulator(platformData).wait(); let args = shouldBreak ? "--nativescript-debug-brk" : "--nativescript-debug-start"; diff --git a/lib/services/livesync/ios-livesync-service.ts b/lib/services/livesync/ios-livesync-service.ts index 1b5bc28eff..31a9c920d4 100644 --- a/lib/services/livesync/ios-livesync-service.ts +++ b/lib/services/livesync/ios-livesync-service.ts @@ -15,6 +15,7 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase { - let projectData: IProjectData = this.$injector.resolve("projectData"); - return this.device.applicationManager.restartApplication(deviceAppData.appIdentifier, projectData.projectName); + if (this.$options.debug) { + return this.$iOSDebugService.debug(); + } else { + let projectData: IProjectData = this.$injector.resolve("projectData"); + return this.device.applicationManager.restartApplication(deviceAppData.appIdentifier, projectData.projectName); + } } protected reloadPage(deviceAppData: Mobile.IDeviceAppData): IFuture {