Skip to content

Commit ef2570b

Browse files
Fix starting of emulator on tns debug <platform> when device is not attached
`tns debug <platform>` command should start emulator in case device is not attached. The current command does not start emulator as we have passed `skipInferPlatform` - when this option is used, devicesService does not know for which platform to start the emulator. Fix this by passing correct options.
1 parent 6df2bc1 commit ef2570b

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

lib/commands/debug.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
this.$config.debugLivesync = true;
3131

32-
await this.$devicesService.initialize({
33-
34-
});
3532
await this.$devicesService.detectCurrentlyAttachedDevices();
3633

3734
const devices = this.$devicesService.getDeviceInstances();
@@ -86,8 +83,7 @@
8683
platform: this.platform,
8784
deviceId: this.$options.device,
8885
emulator: this.$options.emulator,
89-
skipDeviceDetectionInterval: true,
90-
skipInferPlatform: true
86+
skipDeviceDetectionInterval: true
9187
});
9288
// Start emulator if --emulator is selected or no devices found.
9389
if (this.$options.emulator || this.$devicesService.deviceCount === 0) {

lib/services/ios-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
338338
if (!buildConfig.release && !buildConfig.architectures) {
339339
await this.$devicesService.initialize({
340340
platform: this.$devicePlatformsConstants.iOS.toLowerCase(), deviceId: buildConfig.device,
341-
isBuildForDevice: true
341+
skipEmulatorStart: true
342342
});
343343
let instances = this.$devicesService.getDeviceInstances();
344344
let devicesArchitectures = _(instances)

0 commit comments

Comments
 (0)