From c98047bbcfe0f4e9b9ea0bad4e412f16f534c2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Mon, 11 Feb 2019 02:54:40 -0800 Subject: [PATCH] support DEVICE_SET_PATH env var Summary: support for DEVICE_SET_PATH as used by 1W Reviewed By: passy Differential Revision: D14007285 fbshipit-source-id: 79f40355020c67efcb439f470af2fc35ec7fea7e --- src/devices/IOSDevice.js | 5 +++++ src/dispatcher/iOSDevice.js | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/devices/IOSDevice.js b/src/devices/IOSDevice.js index 0d013ddec..e4a405a83 100644 --- a/src/devices/IOSDevice.js +++ b/src/devices/IOSDevice.js @@ -63,10 +63,15 @@ export default class IOSDevice extends BaseDevice { return; } if (!this.log) { + const deviceSetPath = process.env.DEVICE_SET_PATH + ? ['--set', process.env.DEVICE_SET_PATH] + : []; + this.log = child_process.spawn( 'xcrun', [ 'simctl', + ...deviceSetPath, 'spawn', 'booted', 'log', diff --git a/src/dispatcher/iOSDevice.js b/src/dispatcher/iOSDevice.js index cee8db1dc..4a068886c 100644 --- a/src/dispatcher/iOSDevice.js +++ b/src/dispatcher/iOSDevice.js @@ -100,9 +100,16 @@ function queryDevices(store: Store, logger: Logger): Promise { } function getActiveSimulators(): Promise> { - return promisify(execFile)('xcrun', ['simctl', 'list', 'devices', '--json'], { - encoding: 'utf8', - }) + const deviceSetPath = process.env.DEVICE_SET_PATH + ? ['--set', process.env.DEVICE_SET_PATH] + : []; + return promisify(execFile)( + 'xcrun', + ['simctl', ...deviceSetPath, 'list', 'devices', '--json'], + { + encoding: 'utf8', + }, + ) .then(({stdout}) => JSON.parse(stdout).devices) .then(simulatorDevices => { const simulators: Array = Object.values(