Skip to content

Commit 35d9076

Browse files
Merge pull request #4732 from NativeScript/vladimirov/fix-hmr-ios-windows
fix: hmr for iOS does not work on Windows
2 parents c7a762e + cbb8ac8 commit 35d9076

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

lib/common/mobile/ios/device/ios-device.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class IOSDevice extends IOSDeviceBase {
1818
private $injector: IInjector,
1919
protected $iOSDebuggerPortService: IIOSDebuggerPortService,
2020
protected $deviceLogProvider: Mobile.IDeviceLogProvider,
21+
protected $logger: ILogger,
2122
protected $lockService: ILockService,
2223
private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor,
2324
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,

lib/common/mobile/ios/ios-device-base.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice {
77
protected abstract $deviceLogProvider: Mobile.IDeviceLogProvider;
88
protected abstract $iOSDebuggerPortService: IIOSDebuggerPortService;
99
protected abstract $lockService: ILockService;
10+
protected abstract $logger: ILogger;
1011
abstract deviceInfo: Mobile.IDeviceInfo;
1112
abstract applicationManager: Mobile.IDeviceApplicationManager;
1213
abstract fileSystem: Mobile.IDeviceFileSystem;
@@ -22,8 +23,12 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice {
2223
}
2324

2425
await this.attachToDebuggerFoundEvent(appId, projectName);
25-
if (ensureAppStarted) {
26-
await this.applicationManager.startApplication({ appId, projectName });
26+
try {
27+
if (ensureAppStarted) {
28+
await this.applicationManager.startApplication({ appId, projectName });
29+
}
30+
} catch (err) {
31+
this.$logger.trace(`Unable to start application ${appId} on device ${this.deviceInfo.identifier} in getDebugSocket method. Error is: ${err}`);
2732
}
2833

2934
this.cachedSockets[appId] = await this.getDebugSocketCore(appId);

lib/common/mobile/ios/simulator/ios-simulator-device.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class IOSSimulator extends IOSDeviceBase implements Mobile.IiOSDevice {
2222
private $iOSEmulatorServices: Mobile.IiOSSimulatorService,
2323
private $iOSNotification: IiOSNotification,
2424
private $iOSSimulatorLogProvider: Mobile.IiOSSimulatorLogProvider,
25-
private $logger: ILogger) {
25+
protected $logger: ILogger) {
2626
super();
2727
this.applicationManager = this.$injector.resolve(applicationManagerPath.IOSSimulatorApplicationManager, { iosSim: this.$iOSSimResolver.iOSSim, device: this });
2828
this.fileSystem = this.$injector.resolve(fileSystemPath.IOSSimulatorFileSystem, { iosSim: this.$iOSSimResolver.iOSSim });

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "5.4.1",
4+
"version": "5.4.2",
55
"author": "Telerik <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

0 commit comments

Comments
 (0)