diff --git a/src/devices/BaseDevice.js b/src/devices/BaseDevice.js index 253f9a095..93e2d80c7 100644 --- a/src/devices/BaseDevice.js +++ b/src/devices/BaseDevice.js @@ -48,7 +48,7 @@ export type DeviceExport = {| logs: Array, |}; -export type OS = 'iOS' | 'Android' | 'Windows'; +export type OS = 'iOS' | 'Android' | 'Windows' | 'MacOS'; export default class BaseDevice { constructor(serial: string, deviceType: DeviceType, title: string) { diff --git a/src/devices/MacDevice.js b/src/devices/MacDevice.js new file mode 100644 index 000000000..93f62aefc --- /dev/null +++ b/src/devices/MacDevice.js @@ -0,0 +1,22 @@ +/** + * 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 BaseDevice from './BaseDevice.js'; + +export default class MacDevice extends BaseDevice { + os = 'MacOS'; + + constructor() { + super('', 'physical', 'desktop'); + } + + teardown() {} + + supportedColumns(): Array { + return []; + } +} diff --git a/src/dispatcher/windowsDevice.js b/src/dispatcher/desktopDevice.js similarity index 66% rename from src/dispatcher/windowsDevice.js rename to src/dispatcher/desktopDevice.js index 01d2a293a..0c52b4f21 100644 --- a/src/dispatcher/windowsDevice.js +++ b/src/dispatcher/desktopDevice.js @@ -8,14 +8,20 @@ import type {Store} from '../reducers/index.js'; import type {Logger} from '../fb-interfaces/Logger.js'; +import MacDevice from '../devices/MacDevice'; import WindowsDevice from '../devices/WindowsDevice'; export default (store: Store, logger: Logger) => { - if (process.platform !== 'win32') { + var device; + if (process.platform === 'darwin') { + device = new MacDevice(); + } else if (process.platform === 'win32') { + device = new WindowsDevice(); + } else { return; } store.dispatch({ type: 'REGISTER_DEVICE', - payload: new WindowsDevice(), + payload: device, }); }; diff --git a/src/dispatcher/index.js b/src/dispatcher/index.js index cc846662c..f5bceb4bf 100644 --- a/src/dispatcher/index.js +++ b/src/dispatcher/index.js @@ -7,7 +7,7 @@ import androidDevice from './androidDevice'; import iOSDevice from './iOSDevice'; -import windowsDevice from './windowsDevice'; +import desktopDevice from './desktopDevice'; import application from './application'; import tracking from './tracking'; import server from './server'; @@ -23,7 +23,7 @@ export default (store: Store, logger: Logger) => application, androidDevice, iOSDevice, - windowsDevice, + desktopDevice, tracking, server, notifications,