diff --git a/lib/commands/debug.ts b/lib/commands/debug.ts index 5ed5ec1d7e..d11de92990 100644 --- a/lib/commands/debug.ts +++ b/lib/commands/debug.ts @@ -35,8 +35,6 @@ export class DebugPlatformCommand implements ICommand { return; } - await this.$devicesService.detectCurrentlyAttachedDevices({ shouldReturnImmediateResult: false, platform: this.platform }); - await this.$liveSyncCommandHelper.executeLiveSyncOperation([selectedDeviceForDebug], this.platform, { deviceDebugMap: { [selectedDeviceForDebug.deviceInfo.identifier]: true @@ -52,8 +50,6 @@ export class DebugPlatformCommand implements ICommand { this.$errors.fail(DebugCommandErrors.UNABLE_TO_USE_FOR_DEVICE_AND_EMULATOR); } - await this.$devicesService.detectCurrentlyAttachedDevices({ platform: this.platform, shouldReturnImmediateResult: false }); - if (this.$options.device) { const device = await this.$devicesService.getDevice(this.$options.device); return device; diff --git a/lib/common b/lib/common index 218dbb7bb1..b8ec069f9c 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 218dbb7bb1b7dc2429431c8c01aac400974a0de8 +Subproject commit b8ec069f9ce1722129a8e2f05892e58e6b04bab4 diff --git a/lib/declarations.d.ts b/lib/declarations.d.ts index ca9107238a..f131ec9c0c 100644 --- a/lib/declarations.d.ts +++ b/lib/declarations.d.ts @@ -405,9 +405,6 @@ interface IPlatformTemplate { platformTemplate: string; } -interface IEmulator { - emulator: boolean; -} interface IClean { clean: boolean; @@ -449,7 +446,7 @@ interface IPort { port: Number; } -interface IOptions extends ICommonOptions, IBundleString, IPlatformTemplate, IEmulator, IClean, IProvision, ITeamIdentifier, IAndroidReleaseOptions, INpmInstallConfigurationOptions, IPort, IEnvOptions { +interface IOptions extends ICommonOptions, IBundleString, IPlatformTemplate, IHasEmulatorOption, IClean, IProvision, ITeamIdentifier, IAndroidReleaseOptions, INpmInstallConfigurationOptions, IPort, IEnvOptions { all: boolean; client: boolean; compileSdk: number; @@ -482,7 +479,7 @@ interface IAppFilesUpdaterOptions extends IBundle, IRelease, IOptionalWatchAllFi interface IPlatformBuildData extends IAppFilesUpdaterOptions, IBuildConfig, IEnvOptions { } -interface IDeviceEmulator extends IEmulator, IDeviceIdentifier { } +interface IDeviceEmulator extends IHasEmulatorOption, IDeviceIdentifier { } interface IRunPlatformOptions extends IJustLaunch, IDeviceEmulator { } diff --git a/lib/helpers/livesync-command-helper.ts b/lib/helpers/livesync-command-helper.ts index 52adbecc8f..45a674f13d 100644 --- a/lib/helpers/livesync-command-helper.ts +++ b/lib/helpers/livesync-command-helper.ts @@ -21,15 +21,15 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper { } public async executeCommandLiveSync(platform?: string, additionalOptions?: ILiveSyncCommandHelperAdditionalOptions) { + const emulator = this.$options.emulator; await this.$devicesService.initialize({ deviceId: this.$options.device, - platform: platform, - emulator: this.$options.emulator, + platform, + emulator, skipDeviceDetectionInterval: true, skipInferPlatform: !platform }); - await this.$devicesService.detectCurrentlyAttachedDevices({ shouldReturnImmediateResult: false, platform: platform }); const devices = this.$devicesService.getDeviceInstances() .filter(d => !platform || d.deviceInfo.platform.toLowerCase() === platform.toLowerCase()); diff --git a/lib/services/test-execution-service.ts b/lib/services/test-execution-service.ts index b0c3de388a..8105310c29 100644 --- a/lib/services/test-execution-service.ts +++ b/lib/services/test-execution-service.ts @@ -44,7 +44,6 @@ class TestExecutionService implements ITestExecutionService { deviceId: this.$options.device, emulator: this.$options.emulator }); - await this.$devicesService.detectCurrentlyAttachedDevices(); const projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME); const configOptions: IKarmaConfigOptions = JSON.parse(launcherConfig); diff --git a/test/debug.ts b/test/debug.ts index 9ce6c7a2e6..8e55b0c22a 100644 --- a/test/debug.ts +++ b/test/debug.ts @@ -36,7 +36,6 @@ function createTestInjector(): IInjector { }); testInjector.register('devicesService', { initialize: async () => { /* Intentionally left blank */ }, - detectCurrentlyAttachedDevices: async () => { /* Intentionally left blank */ }, getDeviceInstances: (): any[] => { return []; }, execute: async (): Promise => ({}) });