iOS (Swift, SwiftUI)
Native iOS apps use the QuameleonQACore Swift package. It has no React Native dependency and pulls in
KSCrash for crash capture (Mach exceptions, signals, C++ and NSException).
1. Add the Swift package
Section titled “1. Add the Swift package”In Xcode, File → Add Package Dependencies → Add Local…, choose Quameleon/packages/qa-core/ios, and add the
QuameleonQACore library to your app target (Xcode then also resolves KSCrash from GitHub, so the first resolve
needs network access). In a Package.swift the local package’s identity is its folder name, ios:
dependencies: [.package(path: "../Quameleon/packages/qa-core/ios")],targets: [.target(name: "App", dependencies: [.product(name: "QuameleonQACore", package: "ios")])]apps/qa-native-ios is a complete UIKit
example with URLSession calls, WebViews and push.
2. Start production mode
Section titled “2. Start production mode”Call it on the main thread from application(_:didFinishLaunchingWithOptions:) (or your SwiftUI App.init):
import QuameleonQACore
QuameleonPlatform.startProduction(config: QuameleonProductionConfig( apiKey: Secrets.quameleonKey, endpoint: "https://quameleon.qualgent.ai", publicKeyPem: Secrets.quameleonPublicKey // encrypts the spool and uploads))It returns the cached remote config JSON, or nil when production mode did not start. The spool lives in
Application Support (quameleon_prod), which iOS does not purge under disk pressure. QA activation is off by default
outside Debug and Simulator builds. To test a Release-configuration QA build (TestFlight, ad hoc), turn it on in that
build only, never in the App Store configuration:
<key>QuameleonQAActivation</key><true/>3. Network, screens and events
Section titled “3. Network, screens and events”URLSession tasks are captured automatically (resume swizzle plus URLSessionTaskMetrics for DNS, connect, TLS and
TTFB). UIViewController appearances become screen signals.
QuameleonCore.shared.screen(name: "checkout")QuameleonCore.shared.emit(kind: "event", name: "order.placed", propsJson: #"{"items":{"t":"int","v":2}}"#)QuameleonCore.shared.logException(error) // a handled errorSDK 0.5 adds identify, reset and capture, which mirror the JavaScript API:
QuameleonCore.shared.identify("user-123", properties: ["plan": "pro"])QuameleonCore.shared.capture("search.submitted", propsJson: #"{"query_len":{"t":"int","v":7}}"#)Typed props use t ∈ string, int, float, bool, null. See the Swift reference.
4. SwiftUI
Section titled “4. SwiftUI”CheckoutView() .quameleonScreen("Checkout") // screen signal on appear
Button("Place order", action: placeOrder) .quameleonID("checkout.place") // tap target, hierarchy id, assertion handle
BalanceView() .quameleonSensitive() // blacked out in replay and screenshots5. UIKit and private data
Section titled “5. UIKit and private data”button.accessibilityIdentifier = "checkout.place"QuameleonPlatform.markSensitive(balanceView)Secure text fields (isSecureTextEntry) are always masked, and every UITextField and UITextView is masked while
mask_all_inputs is on (always on in production).
6. QA runs
Section titled “6. QA runs”For QA builds, start the core in QA mode from launch arguments. QuameleonNative.start() reads
-quameleon_token / -quameleon_port and installs the platform hooks when a valid token is present:
QuameleonNative.start() // dormant without a tokenThen record on a simulator with
npx quameleon-qa record --ios-udid booted --bundle com.acme.app --out runs/1 --replay, or run
scripted tests with npx quameleon-qa test qa-tests --ios-udid booted. After adding or
updating the SDK in a CocoaPods project, run pod install; new Swift files are only picked up on install.
iOS has no public touch injection, so scripted steps trigger what is under the point through public UIKit API:
controls fire their actions, alert buttons run their action (Cancel through the alert’s Escape key command, others
as its preferred action through Return; on iOS 26 only Cancel, and every button of a React Native alert), swipes
end like a flick (pagers switch pages, pull-to-refresh starts at the top of a list), cells are selected through their delegate, SwiftUI elements are activated, and WebView fields
take typed text. Taps go to the top-most app window under the point, and the hierarchy lists presented controllers
(modals, alerts) and other app windows first. clear_state: true also resets the Simulator’s keychain. Views that
only read raw touches (touchesBegan) can’t be driven; give them a control, a tap recognizer or an accessibility
action. Popped or dismissed view controllers that stay alive are reported as leak (the no_leaks check). The full
matrix is on platform parity.