Skip to content

Commit dd44594

Browse files
respect OS platform before getting devices
1 parent 17a0a3e commit dd44594

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/thoughtworks/device/DeviceManager.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ public Device getDevice(String udid) throws Exception {
3030
public List<Device> getDevices() throws Exception {
3131
List<Device> allDevice = new ArrayList<>();
3232
List<Device> androidDevice = new AndroidManager().getDevices();
33-
List<Device> iOSSimulators = new SimulatorManager().getAllBootedSimulators("iOS");
34-
List<Device> iOSRealDevice = new IOSManager().getDevices();
35-
Stream.of(androidDevice, iOSSimulators, iOSRealDevice).forEach(allDevice::addAll);
33+
if(System.getProperty("os.name").contains("Mac")) {
34+
List<Device> iOSSimulators = new SimulatorManager().getAllBootedSimulators("iOS");
35+
List<Device> iOSRealDevice = new IOSManager().getDevices();
36+
Stream.of(androidDevice, iOSSimulators, iOSRealDevice).forEach(allDevice::addAll);
37+
} else {
38+
Stream.of(androidDevice).forEach(allDevice::addAll);
39+
}
3640
return allDevice;
3741
}
3842
}

0 commit comments

Comments
 (0)