From ddcd0133013dfe38f37337244a86166967d1f16b Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 15 Jul 2016 16:15:22 +0300 Subject: [PATCH] debug break for ios fixed --- lib/declarations.ts | 2 +- lib/device-sockets/ios/socket-request-executor.ts | 6 ++++-- lib/services/ios-debug-service.ts | 11 ++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/declarations.ts b/lib/declarations.ts index 0c88f95797..4a36e295f2 100644 --- a/lib/declarations.ts +++ b/lib/declarations.ts @@ -234,7 +234,7 @@ interface IiOSNotificationService { } interface IiOSSocketRequestExecutor { - executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number): IFuture; + executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): IFuture; executeAttachRequest(device: Mobile.IiOSDevice, timeout: number): IFuture; } diff --git a/lib/device-sockets/ios/socket-request-executor.ts b/lib/device-sockets/ios/socket-request-executor.ts index 688f3e9f7b..1aa75ce8b5 100644 --- a/lib/device-sockets/ios/socket-request-executor.ts +++ b/lib/device-sockets/ios/socket-request-executor.ts @@ -39,14 +39,16 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor { }).future()(); } - public executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number): IFuture { + public executeLaunchRequest(device: Mobile.IiOSDevice, timeout: number, readyForAttachTimeout: number, shouldBreak?: boolean): IFuture { return (() => { let npc = new iOSProxyServices.NotificationProxyClient(device, this.$injector); try { this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.appLaunching, timeout).wait(); process.nextTick(() => { - npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug ); + if(shouldBreak) { + npc.postNotificationAndAttachForData(this.$iOSNotification.waitForDebug ); + } npc.postNotificationAndAttachForData(this.$iOSNotification.attachRequest); }); diff --git a/lib/services/ios-debug-service.ts b/lib/services/ios-debug-service.ts index 0f33fcb35b..30b1e74a6b 100644 --- a/lib/services/ios-debug-service.ts +++ b/lib/services/ios-debug-service.ts @@ -58,10 +58,7 @@ class IOSDebugService implements IDebugService { } else if (this.$options.start) { return this.deviceStart(); } else { - let deploy = this.$platformService.deployOnDevice(this.platform); - deploy.wait(); - - return this.deviceStart(); + return this.deviceDebugBrk(false); } } } @@ -121,18 +118,18 @@ class IOSDebugService implements IDebugService { } // we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification let deploy = this.$platformService.deployOnDevice(this.platform); - this.debugBrkCore(device).wait(); + this.debugBrkCore(device, shouldBreak).wait(); deploy.wait(); }).future()()).wait(); }).future()(); } - private debugBrkCore(device: Mobile.IiOSDevice): IFuture { + private debugBrkCore(device: Mobile.IiOSDevice, shouldBreak?: boolean): IFuture { return (() => { let timeout = this.$utils.getMilliSecondsTimeout(TIMEOUT_SECONDS); let readyForAttachTimeout = this.getReadyForAttachTimeout(timeout); - this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout).wait(); + this.$iOSSocketRequestExecutor.executeLaunchRequest(device, timeout, readyForAttachTimeout, shouldBreak).wait(); this.wireDebuggerClient(() => device.connectToPort(inspectorBackendPort)).wait(); }).future()(); }