Simulator Support
Supported Configurationsโ
| Host | Simulator | Supported | Notes |
|---|---|---|---|
| Apple Silicon Mac (M1/M2/M3/M4) | iOS arm64 Simulator | Yes | Full noise cancellation |
| Intel Mac | iOS arm64 Simulator (Rosetta) | Yes | Requires Rosetta enabled |
| Intel Mac | iOS x86_64 Simulator | No | arm64 binary only |
Enable Rosetta on Intel Macโ
- In Xcode, go to Product โ Destination
- Select Rosetta Simulator (any iPhone model)
Or set it project-wide: Project Settings โ Build Settings โ Architectures โ Excluded Architectures โ add x86_64 for the simulator SDK.
Alternatively, add to your Podfile or Xcode project's xcconfig:
EXCLUDED_ARCHS[sdk=iphonesimulator*] = x86_64
What Happens on Unsupported Simulatorโ
On an x86_64 (Intel) simulator without Rosetta:
- Build succeeds โ the linker finds the
arm64-simulatorslice but skips it - Launch crashes at
df_createโNCKitError.libraryInitis thrown (if caught), or the process crashes withSIGABRT(if not)
do {
let processor = try NCKitProcessor(modelURL: modelURL)
} catch NCKitError.libraryInit {
#if targetEnvironment(simulator)
print("Simulator: use Apple Silicon Mac or Rosetta for NC support")
#else
throw NCKitError.libraryInit
#endif
}
Simulator-Safe Architecture Patternโ
final class NCKitManager {
private var processor: NCKitProcessor?
var isAvailable: Bool { processor != nil }
func initialize() {
do {
let modelURL = try NCKitModelLocator.modelTarGzURL()
processor = try NCKitProcessor(modelURL: modelURL)
} catch {
print("NCKit unavailable: \(error)")
}
}
func denoise(inputURL: URL, outputURL: URL) throws {
guard let proc = processor else {
try FileManager.default.copyItem(at: inputURL, to: outputURL)
return
}
try NCKitFileProcessor.processFile(
inputURL: inputURL,
outputURL: outputURL,
processor: proc
)
}
}
Physical Device Testingโ
For full noise cancellation testing, always use a physical iOS device (iPhone or iPad).