# Building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

**Code:** `built for iOS, linking for simulator` · **Category:** iOS · **Seen on:** iOS

A library contains device-only arm64 code; Apple Silicon simulators also run arm64 and need a separate simulator slice.

## Meaning

Old “fat” frameworks combine device arm64 with simulator x86_64. On Apple Silicon Macs the simulator wants arm64-simulator, which they lack. XCFrameworks solve this; excluding arm64 for the simulator is a temporary workaround that forces Rosetta.

## Common causes

- Old fat .framework/.a without arm64-simulator slice
- Pods built with EXCLUDED_ARCHS hacks
- Prebuilt binary SDK not updated

## Quick fix

1. Update the SDK to an XCFramework version
2. Remove EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64 hacks once dependencies support it
3. Temporarily run the simulator under Rosetta

## Detailed fix by platform

### Shell

1. `xcodebuild -create-xcframework -framework device/My.framework -framework simulator/My.framework -output My.xcframework`

## How to diagnose

1. **Slices** — lipo -info / file on the binary
2. **Settings** — EXCLUDED_ARCHS

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/building-for-ios-simulator-linking-object-built-for-ios)
