Skip to content

Commit cc99451

Browse files
Fix tns debug <platform> --start inconsistent behavior (#3047)
`tns debug <platform>` 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.
1 parent b1c6f18 commit cc99451

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/commands/debug.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ export class DebugPlatformCommand implements ICommand {
2929

3030
await this.$platformService.trackProjectType(this.$projectData);
3131

32+
const selectedDeviceForDebug = await this.getDeviceForDebug();
33+
debugData.deviceIdentifier = selectedDeviceForDebug.deviceInfo.identifier;
34+
3235
if (this.$options.start) {
3336
return this.$debugLiveSyncService.printDebugInformation(await this.debugService.debug(debugData, debugOptions));
3437
}
3538

3639
this.$config.debugLivesync = true;
3740

38-
const selectedDeviceForDebug = await this.getDeviceForDebug();
39-
4041
await this.$devicesService.detectCurrentlyAttachedDevices({ shouldReturnImmediateResult: false, platform: this.platform });
4142

4243
await this.$liveSyncCommandHelper.executeLiveSyncOperation([selectedDeviceForDebug], this.$debugLiveSyncService, this.platform);

0 commit comments

Comments
 (0)