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
This commit is contained in:
committed by
Facebook Github Bot
parent
6431d374c2
commit
c98047bbcf
@@ -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',
|
||||
|
||||
@@ -100,9 +100,16 @@ function queryDevices(store: Store, logger: Logger): Promise<void> {
|
||||
}
|
||||
|
||||
function getActiveSimulators(): Promise<Array<IOSDeviceParams>> {
|
||||
return promisify(execFile)('xcrun', ['simctl', 'list', 'devices', '--json'], {
|
||||
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<iOSSimulatorDevice> = Object.values(
|
||||
|
||||
Reference in New Issue
Block a user