diff --git a/lib/common/mobile/ios/device/ios-device.ts b/lib/common/mobile/ios/device/ios-device.ts index e10a589114..3e75d06f8b 100644 --- a/lib/common/mobile/ios/device/ios-device.ts +++ b/lib/common/mobile/ios/device/ios-device.ts @@ -18,6 +18,7 @@ export class IOSDevice extends IOSDeviceBase { private $injector: IInjector, protected $iOSDebuggerPortService: IIOSDebuggerPortService, protected $deviceLogProvider: Mobile.IDeviceLogProvider, + protected $logger: ILogger, protected $lockService: ILockService, private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor, private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, diff --git a/lib/common/mobile/ios/ios-device-base.ts b/lib/common/mobile/ios/ios-device-base.ts index 62be589cfc..302f7d4112 100644 --- a/lib/common/mobile/ios/ios-device-base.ts +++ b/lib/common/mobile/ios/ios-device-base.ts @@ -7,6 +7,7 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice { protected abstract $deviceLogProvider: Mobile.IDeviceLogProvider; protected abstract $iOSDebuggerPortService: IIOSDebuggerPortService; protected abstract $lockService: ILockService; + protected abstract $logger: ILogger; abstract deviceInfo: Mobile.IDeviceInfo; abstract applicationManager: Mobile.IDeviceApplicationManager; abstract fileSystem: Mobile.IDeviceFileSystem; @@ -22,8 +23,12 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice { } await this.attachToDebuggerFoundEvent(appId, projectName); - if (ensureAppStarted) { - await this.applicationManager.startApplication({ appId, projectName }); + try { + if (ensureAppStarted) { + await this.applicationManager.startApplication({ appId, projectName }); + } + } catch (err) { + this.$logger.trace(`Unable to start application ${appId} on device ${this.deviceInfo.identifier} in getDebugSocket method. Error is: ${err}`); } this.cachedSockets[appId] = await this.getDebugSocketCore(appId); diff --git a/lib/common/mobile/ios/simulator/ios-simulator-device.ts b/lib/common/mobile/ios/simulator/ios-simulator-device.ts index 50a178d4f3..e6b6cbf02b 100644 --- a/lib/common/mobile/ios/simulator/ios-simulator-device.ts +++ b/lib/common/mobile/ios/simulator/ios-simulator-device.ts @@ -22,7 +22,7 @@ export class IOSSimulator extends IOSDeviceBase implements Mobile.IiOSDevice { private $iOSEmulatorServices: Mobile.IiOSSimulatorService, private $iOSNotification: IiOSNotification, private $iOSSimulatorLogProvider: Mobile.IiOSSimulatorLogProvider, - private $logger: ILogger) { + protected $logger: ILogger) { super(); this.applicationManager = this.$injector.resolve(applicationManagerPath.IOSSimulatorApplicationManager, { iosSim: this.$iOSSimResolver.iOSSim, device: this }); this.fileSystem = this.$injector.resolve(fileSystemPath.IOSSimulatorFileSystem, { iosSim: this.$iOSSimResolver.iOSSim }); diff --git a/package.json b/package.json index 93304186f6..59f557644b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "5.4.1", + "version": "5.4.2", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": {