iOS

Investigate SwiftUI and UIKit app behavior with screenshots, user actions, runtime evidence, and tools for live inspection.

Review what happened on screen alongside the logs, network activity, and performance of your iOS app. Ansight gives developers and agents session evidence and guarded tools to inspect the state behind a problem.

The native iOS SDK brings the same Ansight runtime concepts to Swift, UIKit, and SwiftUI apps, including native network capture, Clipboard tools, and simulator-only StoreKit diagnostics.

Open your app repository in a coding agent and send this prompt:

Copyable prompt:

Use https://www.ansight.ai/skills/ios/ansight-install-ios.md to install Ansight in this native iOS app. Keep it in a development build, verify a connected session, and show me the changes.

The setup guide has the manual steps.

Quickstart

In Xcode, add https://github.com/ansight-ai/ansight-sdk.git, select the latest published release with an Up to Next Major Version rule, and add its aggregate Ansight product to the app’s development target:

.product(name: "Ansight", package: "ansight-sdk")

CocoaPods users can add pod 'Ansight' instead. See iOS Packages for every product and package-manager option.

Put runtime initialization in AppDelegate.application(_:didFinishLaunchingWithOptions:). For SwiftUI lifecycle apps, attach an UIApplicationDelegate with @UIApplicationDelegateAdaptor. Use SceneDelegate only for scene-specific UI or pairing presentation, not for one-time runtime initialization.

#if DEBUG
import Ansight

try AnsightRuntime.shared.initializeAndActivateAnsightSdk()
#endif

The iOS Simulator and Mac Catalyst register automatically with the local CLI host through loopback. Do not start a second explicit .auto(...) connection after initialization. A physical iPhone or iPad scans one generic CLI host QR; see Enrollment.

initializeAndActivateAnsightSdk() applies the native developer preset:

  • sample frequency 400ms
  • retention 120s
  • FPS enabled
  • battery disabled
  • UIKit lifecycle and screen-view capture enabled
  • JPEG capture every 2000ms at quality 60, max width 480, and GPU-backed surface capture enabled
  • touch capture enabled
  • host auto-probe enabled
  • full tool access
  • standard native tool suites registered, including Clipboard

Purchase tools remain opt-in through registerPurchaseTools().

Important: Screen capture will result in an FPS drop while the SDK renders, encodes, and transports frames. Disable session JPEG capture for trend-focused runs unless visual evidence is required.

Common Next Steps

  • Use iOS Setup for the full guarded startup and CLI verification flow.
  • Use iOS Packages to choose the aggregate, core, pairing, Objective-C, or individual tool products.
  • Use iOS Security before enabling aggregate setup or native tool products.
  • Use Enrollment to scan once and reconnect automatically.
  • Use Configuration to tune sampling, capture, pairing, and tool guard policy.
  • Use Trends Telemetry to capture FPS, memory, custom metrics, and battery telemetry.
  • Use JPEG Screenshots to record periodic screenshots for session replay or capture a screenshot on demand.
  • Use Crash Capture to configure next-launch crash recovery, retention, and handoff.
  • Use Network Capture to configure the native URL Loading System interceptor and sanitization policy.
  • Use Connectivity Capture to record OS connection state, transport changes, and supported quality estimates.
  • See Native Offline Capture for disconnected recording and host transfer across mobile SDKs, implemented after SDK 1.8.0.
  • Use iOS Motion Capture to forward UIKit shakes or app-owned Core Motion samples.
  • Use Clipboard Tools to inspect or change the active app’s device clipboard.
  • Use Purchase Diagnostics to refresh and validate StoreKit evidence on an Apple simulator.
  • Use Touch Input to capture taps, drags, and cancellations.
  • Use Screen Views to record UIKit, SwiftUI, or custom route changes.
  • Use Capturing Logs for app events, custom client logs, and SDK diagnostics.
  • Use App Lifecycle to track foreground and background state.
  • Use Artifacts to register and serve app-owned diagnostic exports.
  • Use Objective-C when an Objective-C host or bridge layer needs the aggregate SDK through an NSObject facade.
  • Use Tools to register and guard native tool suites.