diff --git a/packages/docs/docs/troubleshooting.md b/packages/docs/docs/troubleshooting.md
index c41e4cfdd..aea613331 100644
--- a/packages/docs/docs/troubleshooting.md
+++ b/packages/docs/docs/troubleshooting.md
@@ -81,3 +81,7 @@ Here is what you can try when the extension got stuck on some errors:
If you need to install an older version of an IDE, you can do so by navigating to the cogwheel menu next to the "install" button in the market place.
+
+### -sec-num- Configureing Alternative Xcode Versions
+
+If you are using alternative Xcode version ( e.g. xcode-beta, ["xcodes"](https://www.xcodes.app/) IDE will only work if xcode-select points to the correct directory to set it up run: `xcode-select --switch ${PathToYourXCode}/Contents/Developer`
\ No newline at end of file
diff --git a/packages/vscode-extension/src/devices/preview.ts b/packages/vscode-extension/src/devices/preview.ts
index 845912093..f439c373e 100644
--- a/packages/vscode-extension/src/devices/preview.ts
+++ b/packages/vscode-extension/src/devices/preview.ts
@@ -24,7 +24,20 @@ export class Preview implements Disposable {
);
Logger.debug(`Launch preview ${simControllerBinary} ${this.args}`);
- const subprocess = exec(simControllerBinary, this.args, { buffer: false });
+
+ let simControllerBinaryEnv: { DYLD_FRAMEWORK_PATH: string } | undefined;
+
+ if (Platform.OS === "macos") {
+ const { stdout } = await exec("xcode-select", ["-p"]);
+ const DYLD_FRAMEWORK_PATH = path.join(stdout, "Library", "PrivateFrameworks");
+ Logger.debug(`Setting DYLD_FRAMEWORK_PATH to ${DYLD_FRAMEWORK_PATH}`);
+ simControllerBinaryEnv = { DYLD_FRAMEWORK_PATH };
+ }
+
+ const subprocess = exec(simControllerBinary, this.args, {
+ buffer: false,
+ env: simControllerBinaryEnv,
+ });
this.subprocess = subprocess;
return new Promise((resolve, reject) => {