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
16 lines
605 B
JavaScript
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);
|
|
}
|