From 1b54e93626f55422fea9b9678479586e390b67b9 Mon Sep 17 00:00:00 2001 From: Shridhar Kalagi Date: Mon, 21 May 2018 14:50:04 +0530 Subject: [PATCH] Adding endpoint to get the booted simulators --- .../com/hariharanweb/remoteappiummanager/Server.java | 1 + .../controller/DeviceController.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/com/hariharanweb/remoteappiummanager/Server.java b/src/main/java/com/hariharanweb/remoteappiummanager/Server.java index 1d6b602..19088b5 100644 --- a/src/main/java/com/hariharanweb/remoteappiummanager/Server.java +++ b/src/main/java/com/hariharanweb/remoteappiummanager/Server.java @@ -46,6 +46,7 @@ public static void main(String[] args) throws IOException { path("/ios", () -> { //Get all iOS Real devices get("/realDevices", deviceController.getIOSRealDevices, new JsonTransformer()); + get("/bootedSims", deviceController.getBootedSims, new JsonTransformer()); path("/webkitproxy", () -> { get("/start", deviceController.startWebkitProxy, new JsonTransformer()); get("/stop", deviceController.stopWebkitProxy, new JsonTransformer()); diff --git a/src/main/java/com/hariharanweb/remoteappiummanager/controller/DeviceController.java b/src/main/java/com/hariharanweb/remoteappiummanager/controller/DeviceController.java index 622e0e1..b092cdb 100644 --- a/src/main/java/com/hariharanweb/remoteappiummanager/controller/DeviceController.java +++ b/src/main/java/com/hariharanweb/remoteappiummanager/controller/DeviceController.java @@ -43,6 +43,17 @@ public DeviceController() { return null; }; + public Route getBootedSims = ((request, response) -> { + try { + List devices = simulatorManager.getAllBootedSimulators("iOS"); + return devices; + } catch (Exception e) { + response.status(404); + response.body(e.getMessage()); + } + return null; + }); + public Route getIOSDevices = ((request, response) -> { try { List devices = iosManager.getDevices();