diff --git a/lib/commands/debug.ts b/lib/commands/debug.ts index 728d38b559..95457625e0 100644 --- a/lib/commands/debug.ts +++ b/lib/commands/debug.ts @@ -66,10 +66,6 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements this.$errors.fail("--release flag is not applicable to this command"); } - if (this.$options.hmr && this.$options.debugBrk) { - this.$errors.fail("--debug-brk and --hmr flags cannot be combined"); - } - const minSupportedWebpackVersion = this.$options.hmr ? LiveSyncCommandHelper.MIN_SUPPORTED_WEBPACK_VERSION_WITH_HMR : null; this.$bundleValidatorHelper.validate(minSupportedWebpackVersion); diff --git a/lib/common/definitions/mobile.d.ts b/lib/common/definitions/mobile.d.ts index e66e93aed9..e3beddaac0 100644 --- a/lib/common/definitions/mobile.d.ts +++ b/lib/common/definitions/mobile.d.ts @@ -106,7 +106,7 @@ declare module Mobile { } interface IiOSDevice extends IDevice { - getDebugSocket(appId: string, projectName: string): Promise; + getDebugSocket(appId: string, projectName: string, ensureAppStarted?: boolean): Promise; destroyDebugSocket(appId: string): Promise; openDeviceLogStream(options?: IiOSLogStreamOptions): Promise; destroyAllSockets(): Promise; diff --git a/lib/common/mobile/ios/ios-device-base.ts b/lib/common/mobile/ios/ios-device-base.ts index ee585c2b25..d9e6d11ae6 100644 --- a/lib/common/mobile/ios/ios-device-base.ts +++ b/lib/common/mobile/ios/ios-device-base.ts @@ -15,7 +15,7 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice { abstract openDeviceLogStream(options?: Mobile.IiOSLogStreamOptions): Promise; @performanceLog() - public async getDebugSocket(appId: string, projectName: string): Promise { + public async getDebugSocket(appId: string, projectName: string, ensureAppStarted: boolean = false): Promise { return this.$lockService.executeActionWithLock( async () => { if (this.cachedSockets[appId]) { @@ -23,7 +23,10 @@ export abstract class IOSDeviceBase implements Mobile.IiOSDevice { } await this.attachToDebuggerFoundEvent(appId, projectName); - await this.applicationManager.startApplication({ appId, projectName }); + if (ensureAppStarted) { + await this.applicationManager.startApplication({ appId, projectName }); + } + this.cachedSockets[appId] = await this.getDebugSocketCore(appId); if (this.cachedSockets[appId]) { diff --git a/lib/services/livesync/ios-device-livesync-service.ts b/lib/services/livesync/ios-device-livesync-service.ts index c7595e4874..249ec41a1e 100644 --- a/lib/services/livesync/ios-device-livesync-service.ts +++ b/lib/services/livesync/ios-device-livesync-service.ts @@ -25,7 +25,9 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen const appId = projectData.projectIdentifiers.ios; try { - this.socket = await this.device.getDebugSocket(appId, projectData.projectName); + // TODO: temp workaround till we setup the sockets along with the app start + const ensureAppStarted = true; + this.socket = await this.device.getDebugSocket(appId, projectData.projectName, ensureAppStarted); } catch (err) { this.$logger.trace(`Error while connecting to the debug socket. Error is:`, err); }