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
This commit is contained in:
committed by
Facebook Github Bot
parent
53b852dbe6
commit
c94c2c8455
15
src/utils/listDevices.js
Normal file
15
src/utils/listDevices.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user