# xctest

Published articles for xctest.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## iOS Startup Performance in Practice, Part 2: Measuring App Launch Time in Production

DevFeed: [iOS Startup Performance in Practice, Part 2: Measuring App Launch Time in Production](<https://devfeed.tech/articles/ios-startup-performance-in-practice-part-2-measuring-app-launch-time-in-production-122639.md>)

Original publisher: [Read original article](<https://hackernoon.com/ios-startup-performance-in-practice-part-2-measuring-app-launch-time-in-production?source=rss>)

Author: oreshina

Published: 2026-11-08T16:47:54Z

Content type: article

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [app startup](<https://devfeed.tech/topics/app-startup.md>), [mobile-app-performance](<https://devfeed.tech/topics/mobile-app-performance.md>), [performance-engineering](<https://devfeed.tech/topics/performance-engineering.md>), [digital experience monitoring](<https://devfeed.tech/topics/digital-experience-monitoring.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [ui-testing](<https://devfeed.tech/topics/ui-testing.md>), [mobile devops](<https://devfeed.tech/topics/mobile-devops.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [buffer](<https://devfeed.tech/tags/buffer.md>), [devices](<https://devfeed.tech/tags/devices.md>), [ios](<https://devfeed.tech/tags/ios.md>), [ios-app-development](<https://devfeed.tech/tags/ios-app-development.md>), [ios-app-launch-time](<https://devfeed.tech/tags/ios-app-launch-time.md>), [ios-performance-testing](<https://devfeed.tech/tags/ios-performance-testing.md>), [ios-startup-performance](<https://devfeed.tech/tags/ios-startup-performance.md>), [launch](<https://devfeed.tech/tags/launch.md>), [measuring](<https://devfeed.tech/tags/measuring.md>), [metrickit](<https://devfeed.tech/tags/metrickit.md>), [milestones](<https://devfeed.tech/tags/milestones.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [performance](<https://devfeed.tech/tags/performance.md>), [production](<https://devfeed.tech/tags/production.md>), [startup](<https://devfeed.tech/tags/startup.md>), [swift](<https://devfeed.tech/tags/swift.md>), [time](<https://devfeed.tech/tags/time.md>), [xcode](<https://devfeed.tech/tags/xcode.md>), [xctest](<https://devfeed.tech/tags/xctest.md>)

### AI overview

Reliable iOS startup measurement requires two complementary clocks: Xcode Organizer or MetricKit captures system launch milestones such as First Draw and resume, while lightweight custom telemetry measures product milestones such as route readiness and interactivity. Define each metric's population and start/end boundaries, then report percentiles, sample counts, and relevant segments; averages can hide slow device or user-state cohorts. When production data identifies a regression, reproduce that cohort on physical hardware with a Release-like build, deterministic data, and controlled network conditions. XCTest provides repeatable launch or signpost benchmarks, while Instruments helps diagnose causes but adds overhead and should not be treated as the final stopwatch. Validate fixes against the same production segment. System metrics cannot infer product readiness, and application timers cannot capture work before app code runs.

### Source excerpt

Learn how to measure iOS startup on real user devices with MetricKit, production milestones, percentiles, segmentation, XCTest, and Instruments.

## Supporting relative paths: XCTest failures in Xcode

DevFeed: [Supporting relative paths: XCTest failures in Xcode](<https://devfeed.tech/articles/supporting-relative-paths-xctest-failures-in-xcode-25402.md>)

Original publisher: [Read original article](<https://smileykeith.com/2021/03/04/supporting-relative-paths/>)

Author: Keith Smiley

Published: 2021-03-05T04:48:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [Xcode](<https://devfeed.tech/topics/xcode.md>), [bazel](<https://devfeed.tech/topics/bazel.md>), [reproducible builds](<https://devfeed.tech/topics/reproducible-builds.md>)

Tags: [bazel](<https://devfeed.tech/tags/bazel.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [failure](<https://devfeed.tech/tags/failure.md>), [source](<https://devfeed.tech/tags/source.md>), [swift](<https://devfeed.tech/tags/swift.md>), [ui](<https://devfeed.tech/tags/ui.md>), [xcode](<https://devfeed.tech/tags/xcode.md>), [xctest](<https://devfeed.tech/tags/xctest.md>)

### AI overview

When Swift is compiled with relative source paths and no `-working-directory`, `#filePath` can remain relative. The excerpt says XCTest then creates `XCTIssue` with that relative path, so clicking a test failure in Xcode's issue navigator may not navigate to the failed test. It describes a workaround: pass Xcode's `SRCROOT` through a scheme environment variable, ensure "Expand Variables Based On" is set to a target, and swizzle `XCTSourceCodeLocation.init(fileURL:lineNumber:)` to remap relative URLs to absolute paths. Call the swizzling code when the test bundle starts, for example through an `NSPrincipalClass` in that bundle's plist. The approach depends on Xcode implementation details and may break; the source advises avoiding it if possible.

### Source excerpt

If you build your iOS app with an alternate build system such as bazel, it's likely that you use relative paths, instead of absolute paths, for compilation. Specifically, when building swift code, Xcode calls the compiler with something like: swiftc [ARGS] /path/to/srcroot/path/to/file1.swift /path/to/srcroot/path/to/file2.swift Where bazel will call the compiler with something like: swiftc [ARGS] path/to/file1.swift path/to/file2.swift Normally, this difference is inconsequential, both compilations will result in a similar enough output. So, the question is: Why would you pick one over the other? For bazel, the answer lies in its core feature of "hermeticity". In bazel's case, being hermetic means that given the same inputs you always produce the same outputs. This means that regardless of what machine you're building on, or what directory your source is cloned in, the results should be the same. Because, those details aren't considered important inputs in the build. Unfortunately, in a few places, Xcode relies on paths being absolute. Today, we'll look at how Xcode reports test failures in the UI. Specifically the underlying XCTIssue that XCTest creates is expected to be instantiated with an absolute path. This absolute path is populated from the #filePath (previously #file) keyword which is supposed to reference the absolute path of the current source file. The first question is: How does the Swift compiler know what the absolute path of the current file is? It's easy when Xcode passes an absolute path to the compiler. But, what if you pass a relative path? In this case, the Swift compiler uses the directory passed with the -working-directory argument to make the path absolute. It turns out if you don't pass this argument, the compiler has no choice but to use the relative path. This means the #filePath keyword ends up translating to a relative path, which means the XCTIssue is created with a relative path. With relative paths when you run your tests in Xcode and