Files
flipper/src/utils/listDevices.js
Pritesh Nandgaonkar c94c2c8455 Add list-devices option to list the available devices.
Summary: This diff adds an option of `--list-devices` which will list the currently active devices on the machine. It will be later used to select a device by passing an `id` as an argument.

Reviewed By: danielbuechele

Differential Revision: D15524250

fbshipit-source-id: 7a79ceb1e431a25adcb4e05bc0cb68407c527806
2019-05-29 09:54:38 -07:00

16 lines
605 B
JavaScript

/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import {getActiveAndroidDevices} from '../dispatcher/androidDevice';
import {getActiveDevicesAndSimulators} from '../dispatcher/iOSDevice';
import type BaseDevice from '../devices/BaseDevice';
export async function listDevices(): Promise<Array<BaseDevice>> {
const androidDevices = await getActiveAndroidDevices();
const iOSDevices = await getActiveDevicesAndSimulators();
return iOSDevices.concat(androidDevices);
}