Skip to main content
Code samples

Simulator Support

Supported Configurations (NCKit 1.2.1+)โ€‹

HostSimulatorSupportedNotes
Apple Silicon Mac (M1/M2/M3/M4)iOS arm64 SimulatorYesios-arm64_x86_64-simulator slice
Intel MaciOS x86_64 SimulatorYesNative x86_64 from 1.2.1+
Intel MaciOS arm64 Simulator (Rosetta)YesOptional; not required on 1.2.1+

Use Exact Version 1.2.1 or newer so Xcode links the universal simulator slice. See Requirements.

Older releases (before 1.2.1)โ€‹

Releases before 1.2.1 shipped ios-arm64-simulator only. On Intel Mac:

SimulatorSupported
x86_64 (native)No
arm64 (Rosetta)Yes

Enable Rosetta on Intel Mac (pre-1.2.1 only)โ€‹

  1. In Xcode, go to Product โ†’ Destination
  2. Select Rosetta Simulator (any iPhone model)

Or add to your Podfile / xcconfig:

EXCLUDED_ARCHS[sdk=iphonesimulator*] = x86_64

What Happens on Unsupported Simulatorโ€‹

On an older NCKit build with only ios-arm64-simulator, running on an Intel x86_64 simulator without Rosetta:

  1. Build may succeed โ€” linker skips the arm64 simulator slice
  2. Launch crashes at df_create โ€” NCKitError.libraryInit (or SIGABRT if uncaught)

Fix: Upgrade to 1.2.1 or use Rosetta / a physical device.

do {
let processor = try NCKitProcessor(modelURL: modelURL)
} catch NCKitError.libraryInit {
#if targetEnvironment(simulator)
print("Simulator: upgrade to NCKit 1.2.1+ or use Rosetta / device")
#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).