From 6213f9b136da2e25e631ae0a177772d098e7b0f6 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 10 Aug 2017 11:21:20 +0300 Subject: [PATCH] Fix `tns debug --start` inconsistent behavior `tns debug ` will check all available devices and will prompt the user to select device for debugging. In case the terminal is not interactive, it will select the emulator/device with highest API level. However, adding `--start` causes failure as the described logic is not used. So ensure we have this behavior even when `--start` is used. --- lib/commands/debug.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands/debug.ts b/lib/commands/debug.ts index b0322844f6..144ae61d23 100644 --- a/lib/commands/debug.ts +++ b/lib/commands/debug.ts @@ -29,14 +29,15 @@ export class DebugPlatformCommand implements ICommand { await this.$platformService.trackProjectType(this.$projectData); + const selectedDeviceForDebug = await this.getDeviceForDebug(); + debugData.deviceIdentifier = selectedDeviceForDebug.deviceInfo.identifier; + if (this.$options.start) { return this.$debugLiveSyncService.printDebugInformation(await this.debugService.debug(debugData, debugOptions)); } this.$config.debugLivesync = true; - const selectedDeviceForDebug = await this.getDeviceForDebug(); - await this.$devicesService.detectCurrentlyAttachedDevices({ shouldReturnImmediateResult: false, platform: this.platform }); await this.$liveSyncCommandHelper.executeLiveSyncOperation([selectedDeviceForDebug], this.$debugLiveSyncService, this.platform);