Skip to content

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).

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.

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:

Info.plist (QA configuration only)
<key>QuameleonQAActivation</key>
<true/>

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 error

SDK 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.

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 screenshots
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).

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 token

Then 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.