diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json index c1c796eea..a8633c7fd 100644 --- a/packages/vscode-extension/package.json +++ b/packages/vscode-extension/package.json @@ -17,8 +17,7 @@ ], "version": "0.0.20", "engines": { - "vscode": "^1.75.0", - "os": "darwin" + "vscode": "^1.75.0" }, "extensionKind": [ "workspace" diff --git a/packages/vscode-extension/src/devices/DeviceManager.ts b/packages/vscode-extension/src/devices/DeviceManager.ts index bf2b6ef74..41af3ceb2 100644 --- a/packages/vscode-extension/src/devices/DeviceManager.ts +++ b/packages/vscode-extension/src/devices/DeviceManager.ts @@ -108,7 +108,7 @@ export class DeviceManager implements DeviceManagerInterface { let shouldLoadSimulators = Platform.OS === "macos"; - if (!(await checkXcodeExists())) { + if (shouldLoadSimulators && !(await checkXcodeExists())) { shouldLoadSimulators = false; Logger.debug("Couldn't list iOS simulators as XCode installation wasn't found"); } diff --git a/packages/vscode-extension/src/utilities/platform.ts b/packages/vscode-extension/src/utilities/platform.ts index 47948b408..7303e6517 100644 --- a/packages/vscode-extension/src/utilities/platform.ts +++ b/packages/vscode-extension/src/utilities/platform.ts @@ -1,6 +1,6 @@ import os from "os"; -const OS: "macos" | "windows" = (() => { +const OS: "macos" | "windows" | "unsupported" = (() => { const platform = os.platform(); switch (platform) { case "darwin": @@ -8,13 +8,14 @@ const OS: "macos" | "windows" = (() => { case "win32": return "windows"; default: - throw new Error("Unsupported platform"); + return "unsupported"; } })(); export const Platform = { OS, select: (obj: { macos: R; windows: T }) => { - return obj[Platform.OS]; + // we assume that the 'unsupported' OS type will never occur here + return Platform.OS !== "unsupported" ? obj[Platform.OS] : obj["macos"]; }, };