# How we improved our iOS CI infrastructure with observability tools

[Grab](https://yomu.fyi/company/grab) · Bunty Madan · May 18, 2023

**Type:** Problem & solution

## Summary

Upgrading to Xcode 13.1 introduced severe CI test instability and high CPU utilisation for Grab's iOS development team. To address this, the team integrated observability tools across their UITest pipeline to pinpoint performance bottlenecks and test flakiness. Interventions included isolating spotlight.app to curb CPU spikes, replacing Safari with a mock browser for deep link tests, and booting simulators with pre-granted permissions. The team also built custom network tracking tools to enforce resource mocking and transitioned tests away from arbitrary sleep commands to explicit wait wrappers. These combined changes cut CI runtimes, decreased CPU utilisation by over 50%, and stabilized automated test executions.

## Context

Upgrading to Xcode 13.1 in April 2022 caused CI test instability and Spotlight-related high CPU utilisation across Grab's iOS UITest jobs.

## Approach / What changed

Grab used observability tools to inspect the CI process, temporarily moved spotlight.app during tests, built a mock browser for deep link validation, booted simulators with pre-configured permissions, tracked network calls with custom tooling, and replaced arbitrary sleep calls with explicit wait wrappers.

## Takeaways

- Moving spotlight.app to a temporary folder during UITests decreased Xcode 13.1 CPU utilisation by more than 50%.
- Replacing iOS Safari with an internal mock browser for deep link tests reduced CI execution time by 20%.
- Booting the iOS simulator with pre-granted permissions eliminated in-test permission prompts and improved performance by 5%.

**Tags:** [CI/CD](https://yomu.fyi/topic/ci-cd), [iOS](https://yomu.fyi/topic/ios), [Observability](https://yomu.fyi/topic/observability), [Performance](https://yomu.fyi/topic/performance), [Testing](https://yomu.fyi/topic/testing)

[Read original post](https://engineering.grab.com/iOS-CI-infrastructure-with-observability-tools)
