(options?: MobilecliDevicesOptions)
| 169 | } |
| 170 | |
| 171 | getDevices(options?: MobilecliDevicesOptions): MobilecliDevicesResponse { |
| 172 | const args = ["devices"]; |
| 173 | |
| 174 | if (options) { |
| 175 | if (options.includeOffline) { |
| 176 | args.push("--include-offline"); |
| 177 | } |
| 178 | |
| 179 | if (options.platform) { |
| 180 | if (options.platform !== "ios" && options.platform !== "android") { |
| 181 | throw new Error(`Invalid platform: ${options.platform}. Must be "ios" or "android"`); |
| 182 | } |
| 183 | |
| 184 | args.push("--platform", options.platform); |
| 185 | } |
| 186 | |
| 187 | if (options.type) { |
| 188 | if (options.type !== "real" && options.type !== "emulator" && options.type !== "simulator") { |
| 189 | throw new Error(`Invalid type: ${options.type}. Must be "real", "emulator", or "simulator"`); |
| 190 | } |
| 191 | |
| 192 | args.push("--type", options.type); |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | const mobilecliOutput = this.executeCommand(args); |
| 197 | return JSON.parse(mobilecliOutput) as MobilecliDevicesResponse; |
| 198 | } |
| 199 | } |
no test coverage detected