Product Benefits Pricing Guides Docs About Contact us Try it out
Analytics tools

PostHog iOS Build Context Event Tracking

PostHog iOS build context tracking: use Xcode and SDK version on install and update events to find toolchain-linked crashes and drop-offs.

· 3 min read

When an iOS release goes wrong, the first question is usually “what changed?” The code diff is obvious. The toolchain is not. A new Xcode version can change default behaviour, link a different SDK and shift how your app runs, all without a single line of your own code changing.

PostHog iOS SDK 3.91.0 now adds the Xcode version and the iOS SDK the host app was built with to the Application Installed and Application Updated events. That gives you build context inside your analytics, not just in your CI logs.

Without it, a spike in crashes or a dip in onboarding after an update is hard to pin on the build. You end up comparing app versions that were built on different machines and guessing.

Data Points to Track

  • xcode_version: the Xcode used to build the release, taken from the lifecycle events
  • build_sdk: the iOS SDK the app was compiled against
  • app_version and build_number: the release being compared
  • previous_version: from Application Updated, so you can see upgrade paths
  • os_version: the iOS version on the device running the build
  • device_model: hardware, since toolchain issues are often device-specific
  • first_session_after_update: whether the event is the first session on the new build
  • crash_free_session: outcome per session, to compare across toolchains
  • sdk_version: the PostHog SDK version in use

Setup Steps

  1. Upgrade the PostHog iOS SDK to 3.91.0 or later.
  2. Keep lifecycle capture on. The new properties only appear on the automatic Application Installed and Application Updated events.
  3. Build a cohort of users by xcode_version using those events.
  4. Join cohorts to outcomes. Compare crash-free sessions, onboarding completion and retention across the cohorts.
  5. Record toolchain changes in a release note or annotation each time you move to a new Xcode.
  6. Roll out in phases. Release a toolchain bump to a small percentage first, and watch the cohorts.
  7. Alert when a new toolchain cohort has a crash-free rate more than one point below the previous one.

Actionable Insights

If the new Xcode cohort has more crashes on older iOS versions, you likely have a deployment target or linking issue. Check the minimum OS setting and any frameworks that behave differently on older systems.

A drop in conversion with no matching crash increase points at behavioural changes, such as layout or text rendering differences. Look at screens where the build SDK changes default styling.

When metrics are identical across toolchains, you have evidence to move faster. A clean comparison lets you adopt new Xcode versions with confidence rather than delaying them out of caution.

Use the upgrade path data too. Users jumping several versions at once often hit migration problems that step-by-step upgraders never see.

Common Pitfalls

Do not compare cohorts of very different sizes without confidence intervals. A 2% cohort will swing wildly. Also remember that the properties describe the build, not the user. If you want them on every event, add them yourself as super properties.