diff --git a/lib/services/ios-debug-service.ts b/lib/services/ios-debug-service.ts index 2692206772..32d78c6685 100644 --- a/lib/services/ios-debug-service.ts +++ b/lib/services/ios-debug-service.ts @@ -202,16 +202,21 @@ class IOSDebugService implements IDebugService { } catch (e) { this.$errors.failWithoutHelp(`The application ${projectId} timed out when performing the NativeScript debugger handshake.`); } + this.readyForAttachAction(iosDevice).wait(); break; case readyForAttach: - createWebSocketProxy(this.$logger, (callback) => connectEventually(() => iosDevice.connectToPort(InspectorBackendPort), callback)); - this.executeOpenDebuggerClient().wait(); + this.readyForAttachAction(iosDevice).wait(); break; } }).future()()).wait(); }).future()(); } + private readyForAttachAction(iosDevice: iOSDevice.IOSDevice): IFuture { + createWebSocketProxy(this.$logger, (callback) => connectEventually(() => iosDevice.connectToPort(InspectorBackendPort), callback)); + return this.executeOpenDebuggerClient(); + } + public executeOpenDebuggerClient(): IFuture { if (this.$options.client) { return this.openDebuggingClient();