Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Rosetta Simulator Instructions #4599

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/troubleshooting/building-the-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,33 @@ 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
```

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.

:::note

This approach configures Detox specifically to build and run with Rosetta without affecting your app's regular builds. To run your app with Rosetta in Xcode, enable Rosetta simulator destinations via Xcode.

:::