Instrument
iOS
Capture iOS identity, events, errors, crashes, and backend request context.
The native Anectico package supports iOS 15 and later with no runtime dependencies beyond Apple system
frameworks.
Install with Swift Package Manager
In Xcode, choose File → Add Package Dependencies… and add the Anectico repository. Or add it to
Package.swift:
dependencies: [
.package(url: "https://github.com/anectico/anectico.git", from: "0.1.0"),
],
targets: [
.target(name: "MyApp", dependencies: [.product(name: "Anectico", package: "anectico")]),
],
During early access, use the version or checkout supplied during onboarding.
Configure once
Call Anectico.configure in your SwiftUI App initializer or
application(_:didFinishLaunchingWithOptions:):
import Anectico
Anectico.configure(
AnecticoOptions(
apiKey: "an_...",
environment: "production",
release: "[email protected]+318",
dist: "318"
)
)
Methods called before configuration are no-ops with a warning; SDK failures do not throw into the
application. Async bootstrap is supported: if configuration finishes after the application is
already active, Anectico catches up the missed UIKit notification and emits that process’s
$app_opened once. Later background-to-foreground transitions emit one additional
$app_opened each; duplicate notifications within one lifecycle phase are ignored. Recurring
flushes stay dormant in the background after one explicit background flush.
Use a project-scoped key with ingest:write and analytics:write. Do not include read, management,
or agent scopes in the application.
Connect identity and events
Anectico.identify("user_8842", set: ["email": "[email protected]", "plan": "pro"])
Anectico.group(type: "company", key: "acme")
Anectico.capture("checkout_started", properties: ["cart_size": 3])
Anectico.screen("Checkout")
// On logout:
Anectico.reset()
reset also clears global error-user context and buffered breadcrumbs, preventing
the prior account’s diagnostic context from attaching to the next account on a
shared device.
Capture errors and crashes
Anectico.addBreadcrumb(category: "navigation", message: "opened checkout")
do {
try checkout()
} catch {
Anectico.captureError(error)
}
Fatal signals and uncaught exceptions are spooled and delivered on the next launch. Disable handler
installation with enableCrashReporting: false only when another crash SDK must own the process
handlers.
The SDK keeps the complete Mach-O image list only in its private crash sidecar. A recovered envelope carries the per-frame UUID/load address plus a bounded table of frame-referenced images, preventing large simulator image sets from exceeding the ingest attribute limit while preserving dSYM symbolication.
Anectico classifies a caught Swift error or explicitly captured Objective-C exception as handled and nonfatal. An uncaught Objective-C exception or fatal signal is unhandled and fatal, with a distinct mechanism in each case. The occurrence also includes release/distribution, SDK/platform, hardware model code/family, OS version, and app version/build. Fatal-signal recovery uses the crash-time snapshot even when the application is upgraded before relaunch.
This context is privacy-safe: a model code such as iPhone15,4 identifies a device family, not one
phone. Anectico does not collect IDFV, the user-assigned device name, serial number, or installation ID.
These automatic values and crash semantics cannot be replaced through CaptureOptions.tags.
Upload the release build’s dSYM:
anectico symbols upload-dsym MyApp.dSYM
The CLI accepts either the .dSYM bundle or its exact Mach-O file under
Contents/Resources/DWARF/; it locates the bundle’s Xcode-named executable and uploads a
fat/universal binary without splitting it. Anectico matches each in-app frame to an uploaded dSYM slice
by the exact Mach-O image UUID; release and distribution are not dSYM lookup keys. Use the artifact
from the archive that produced the installed application.
Propagate to your backend
var request = URLRequest(url: url)
AnecticoPropagation.apply(to: &request)
This adds W3C trace and customer baggage. Apply it only to trusted application backends. iOS does not swizzle networking, so propagation is explicit.
Verify
Identify a test user, capture an event and caught error, then call Anectico.flush. Confirm both appear
under the same customer. For a crash test, relaunch before checking because fatal data is sent on the
next launch. In the Issue story, compare Handling, Mechanism, Release, Distribution, SDK / Platform,
Device, OS, and App version / build between the caught and fatal occurrences.