From 560951475a406640b070f38645935722b21924bb Mon Sep 17 00:00:00 2001 From: Kushal Agrawal Date: Sun, 6 Oct 2024 14:58:54 +0530 Subject: [PATCH] chore: add detox build docs for running in rosetta --- .../troubleshooting/building-the-app.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/website/versioned_docs/version-20.x/troubleshooting/building-the-app.md b/website/versioned_docs/version-20.x/troubleshooting/building-the-app.md index cf7a041957..4cfff1a0fb 100644 --- a/website/versioned_docs/version-20.x/troubleshooting/building-the-app.md +++ b/website/versioned_docs/version-20.x/troubleshooting/building-the-app.md @@ -128,3 +128,27 @@ packagingOptions { exclude 'META-INF/LICENSE' } ``` + +### Running Detox in a Rosetta environment + +When working with dependencies that require running your iOS app in a Rosetta simulator, you may encounter issues with the `detox build` command. These issues often relate to SwiftEmitModule or SwiftCompile errors. To resolve this, follow these steps: + +1. Modify your build command in the Detox configuration: + +```json +"build": "xcodebuild -workspace ios/MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build" +``` + +2. Run the following command in your terminal to ensure Xcode is properly selected: + +```bash +sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer +``` + +3. Launch the iOS simulator in Rosetta mode: + +```bash +arch -x86_64 /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator +``` + +After following these steps, the `detox build` command should run without errors in your Rosetta environment.