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

Commit cc14575

Browse files
author
Tsvetan Raikov
committed
Fixed: Option --device {DeviceName} not working for emulate/run/debug/deploy
1 parent c10c9de commit cc14575

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mobile/mobile-core/devices-service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ export class DevicesService implements Mobile.IDevicesService {
213213
return searchedDevice;
214214
}
215215

216+
public getDeviceByName(name: string): Mobile.IDevice {
217+
return _.find(this.getDeviceInstances(), (device: Mobile.IDevice) => { return device.deviceInfo.displayName === name; });
218+
}
219+
216220
private startLookingForDevices(): IFuture<void> {
217221
return (() => {
218222
this.$logger.trace("startLookingForDevices; platform is %s", this._platform);
@@ -244,6 +248,8 @@ export class DevicesService implements Mobile.IDevicesService {
244248
device = this.getDeviceByIdentifier(deviceOption);
245249
} else if (helpers.isNumber(deviceOption)) {
246250
device = this.getDeviceByIndex(parseInt(deviceOption, 10));
251+
} else {
252+
device = this.getDeviceByName(deviceOption);
247253
}
248254

249255
if (!device) {

0 commit comments

Comments
 (0)