Skip to content

Commit 54d1bcf

Browse files
Set correct timeout on LiveSync (#2996)
1 parent c2ff812 commit 54d1bcf

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const LIVESYNC_EXCLUDED_FILE_PATTERNS = ["**/*.js.map", "**/*.ts"];
1717
export const XML_FILE_EXTENSION = ".xml";
1818
export const PLATFORMS_DIR_NAME = "platforms";
1919
export const CODE_SIGN_ENTITLEMENTS = "CODE_SIGN_ENTITLEMENTS";
20+
export const AWAIT_NOTIFICATION_TIMEOUT_SECONDS = 9;
2021

2122
export class PackageVersion {
2223
static NEXT = "next";

lib/services/ios-debug-service.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as path from "path";
44
import * as log4js from "log4js";
55
import { ChildProcess } from "child_process";
66
import { DebugServiceBase } from "./debug-service-base";
7-
import { CONNECTION_ERROR_EVENT_NAME } from "../constants";
7+
import { CONNECTION_ERROR_EVENT_NAME, AWAIT_NOTIFICATION_TIMEOUT_SECONDS } from "../constants";
88
import { getPidFromiOSSimulatorLogs } from "../common/helpers";
99

1010
import byline = require("byline");
@@ -13,7 +13,6 @@ const inspectorBackendPort = 18181;
1313
const inspectorAppName = "NativeScript Inspector.app";
1414
const inspectorNpmPackageName = "tns-ios-inspector";
1515
const inspectorUiDir = "WebInspectorUI/";
16-
const TIMEOUT_SECONDS = 9;
1716

1817
class IOSDebugService extends DebugServiceBase implements IPlatformDebugService {
1918
private _lldbProcess: ChildProcess;
@@ -176,7 +175,7 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
176175
}
177176

178177
private async debugBrkCore(device: Mobile.IiOSDevice, debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
179-
await this.$iOSSocketRequestExecutor.executeLaunchRequest(device.deviceInfo.identifier, TIMEOUT_SECONDS, TIMEOUT_SECONDS, debugData.applicationIdentifier, debugOptions.debugBrk);
178+
await this.$iOSSocketRequestExecutor.executeLaunchRequest(device.deviceInfo.identifier, AWAIT_NOTIFICATION_TIMEOUT_SECONDS, AWAIT_NOTIFICATION_TIMEOUT_SECONDS, debugData.applicationIdentifier, debugOptions.debugBrk);
180179
return this.wireDebuggerClient(debugData, debugOptions, device);
181180
}
182181

@@ -188,7 +187,7 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
188187
}
189188

190189
private async deviceStartCore(device: Mobile.IiOSDevice, debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
191-
await this.$iOSSocketRequestExecutor.executeAttachRequest(device, TIMEOUT_SECONDS, debugData.applicationIdentifier);
190+
await this.$iOSSocketRequestExecutor.executeAttachRequest(device, AWAIT_NOTIFICATION_TIMEOUT_SECONDS, debugData.applicationIdentifier);
192191
return this.wireDebuggerClient(debugData, debugOptions, device);
193192
}
194193

lib/services/livesync/ios-device-livesync-service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen
3737
return false;
3838
}
3939
} else {
40-
let timeout = 9000;
41-
await this.$iOSSocketRequestExecutor.executeAttachRequest(this.device, timeout, projectId);
40+
await this.$iOSSocketRequestExecutor.executeAttachRequest(this.device, constants.AWAIT_NOTIFICATION_TIMEOUT_SECONDS, projectId);
4241
this.socket = await this.device.connectToPort(IOSDeviceLiveSyncService.BACKEND_PORT);
4342
}
4443

0 commit comments

Comments
 (0)