# Deep Dive into iOS Automation at Grab - Integration Testing

[Grab](https://yomu.fyi/company/grab) · Sun Xiangxin · Apr 18, 2017

**Type:** Problem & solution

## Summary

Grab replaced third-party cloud CI services with an in-house Xcode Server pipeline to run automated iOS integration tests across an expanding engineering team. Instead of performing fresh repository clones on shared cloud instances, Xcode Server pulls code incrementally and mirrors local developer configurations. The team automated testing bots through Ruby scripts and Arcanist hooks tied to Phabricator code reviews, dynamically provisioning bots on diffs and deleting them after merges. This architecture preserves step-by-step UI test execution logs and screenshots for easier failure diagnostics. To maintain stability on on-premises hardware, pre-integration scripts clear application cache states using simctl commands.

## Context

Rapid team growth from 3 to 20 iOS engineers created automated CI bottlenecks, including persistent integration failures on Travis after iOS updates, slow support turnarounds, and insufficient visibility into UI test failures.

## Approach / What changed

Grab built an in-house continuous integration workflow using Xcode Server, triggering and tearing down test bots via Ruby scripts and Arcanist hooks integrated with Phabricator.

## Takeaways

- Xcode Server accelerates integration runs by pulling latest branch commits rather than executing fresh clones of the entire repository.
- Bot lifecycles can be automated via HTTP requests to the Xcode Server REST API and hooked directly into code review tools like Phabricator.
- Cached application builds persisting across integrations can be resolved by executing xcrun simctl uninstall in pre-integration scripts.

**Tags:** [CI/CD](https://yomu.fyi/topic/ci-cd), [Developer Experience](https://yomu.fyi/topic/developer-experience), [iOS](https://yomu.fyi/topic/ios), [Testing](https://yomu.fyi/topic/testing)

[Read original post](https://engineering.grab.com/deep-dive-into-ios-automation-at-grab-integration-testing)
