How much resources does Xcode use when building/testing?

Theodore Gonzalez
WanderCodes
Published in
2 min readMay 10, 2020

The question is, how much ram and computing power does xcode actually use when building/testing? Does it always make sense to buy the best machine available?

In this example, the swift project is around 120MB excluding dependencies.
We use carthage/ rome for dependencies so no significant build time is spent on dependencies.

Machine
- iMac (Retina 5K, 27-inch, Late 2015)
- Processor: 4 GHz Quad-Core Intel Core i7
- Ram: 64 GB 1867 MHz DDR3

Environment
- fastlane 2.144
- Xcode 11.4 new build system
- swift 5
- mac OS 10.15.3

Unit tests specifications
- Not executing in parallel
- Devices iPhone 6s (iOS 12.4) and iPhone 11 (iOS 13)
- 1600 tests per device with total run time of 3:59 minutes

UITest specifications
- Execute in Parallel (3 simulators)
- Devices iPhone 6s (iOS 12.4) and iPhone 11 (iOS 13)
- 70 uitests per device with total run time of 6:22 minutes

Here is our findings:

Recommended ram: 32GB
The mac is using 8.8 GB of ram when not building anything.
It consumes maximum 10.8 GB (2 GB difference) when building
It consumes maximum 26.7 GB (17.9 GB difference) when testing.
After each step, the memory gets freed.
Note that archiving for distribution uses all your computing power but doesn’t use much ram so I didn’t add it here.
Therefore, for projects like this, use a mac that has at least 27GB.

Recommended clock speed/cores:

Regarding number of cores, veertu.com had a study about how much build time is reduced when you increase cores on Mac Pros running Anka or VMWare.

Regarding processing power in general, when I tried running two xcodebuilds in parallel on this mac, each operation’s build time took twice as long as when running just one operation at a time.
xcodebuild actually uses all available computing power so get as much as your budget allows.

PS: I haven’t tried a 2019 Mac Pro

Let me know your findings!

--

--