Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get combined code coverage for a Universal App?

Tags:

xcode

xctest

If you have a Universal App (iPhone and iPad) which has code which only executes on either of the platforms, does anyone know how to run tests on 2 simulators (1 iPhone and 1 iPad) and combining the code coverage report? I've looked at Slather, then looked at XC Test Plan, but I can't see how to set the simulator for each of the 2 Test Plan configurations? I tried setting the destination platform as an argument, but it didn't work. and then there's the combining.

like image 469
snapper48 Avatar asked Oct 15 '25 04:10

snapper48


1 Answers

You should run tests with bash command xcodebuild and pass multiple destinations at once.

Alternatively, you can use bash command xcrun xcresulttool merge to merge multiple xcresult files. This way you'll get the combined coverage report (with the ability to see by platform)

enter image description here

like image 98
Roman Zakharov Avatar answered Oct 18 '25 00:10

Roman Zakharov