Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 65df95e

Browse files
committed
Start device detection interval when tns run command is executed.
We need this in order to handle the case when `tns run --bundle` command is executed and the last connected Android device gets disconnected. In this case we need to receive DEVICE_LOST event for the android device. Currently this was impossible because all connected android devices are checked only once - at the beginning of the execution of the command.
1 parent 4b9af46 commit 65df95e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mobile/mobile-core/devices-service.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -558,19 +558,19 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
558558

559559
if (platform && deviceOption) {
560560
this._platform = this.getPlatform(deviceInitOpts.platform);
561-
await this.detectCurrentlyAttachedDevices(deviceInitOpts);
561+
await this.startLookingForDevices(deviceInitOpts);
562562
this._device = await this.getDevice(deviceOption);
563563
if (this._device.deviceInfo.platform !== this._platform) {
564564
this.$errors.fail(constants.ERROR_CANNOT_RESOLVE_DEVICE);
565565
}
566566
this.$logger.warn("Your application will be deployed only on the device specified by the provided index or identifier.");
567567
} else if (!platform && deviceOption) {
568-
await this.detectCurrentlyAttachedDevices(deviceInitOpts);
568+
await this.startLookingForDevices(deviceInitOpts);
569569
this._device = await this.getDevice(deviceOption);
570570
this._platform = this._device.deviceInfo.platform;
571571
} else if (platform && !deviceOption) {
572572
this._platform = this.getPlatform(platform);
573-
await this.detectCurrentlyAttachedDevices(deviceInitOpts);
573+
await this.startLookingForDevices(deviceInitOpts);
574574
} else {
575575
// platform and deviceId are not specified
576576
if (deviceInitOpts.skipInferPlatform) {
@@ -581,7 +581,7 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
581581
await this.startLookingForDevices(deviceInitOpts);
582582
}
583583
} else {
584-
await this.detectCurrentlyAttachedDevices(deviceInitOpts);
584+
await this.startLookingForDevices(deviceInitOpts);
585585

586586
const devices = this.getDeviceInstances();
587587
const platforms = _(devices)

0 commit comments

Comments
 (0)