Converting the coverage report to xml format to be read by sonarqube for ios application

xcodebuild test -workspace xxx.xcworkspace -scheme xxx -destination “platform=iOS Simulator,name=iPhone 15 Pro” -derivedDataPath Build/ -enableCodeCoverage YES -resultBundlePath TestResults/TestResults.xcresult
TestResults/TestResults.xcresult is created in the project directory.

find TestResults -name “*.xcresult” -exec bash xccov-to-sonarqube-generic.sh {} >> coverage.xml ;

  • Coverage.xml is generated using xccov-to-sonarqube-generic.sh.

-Pay attention to the parameters when using a sonar scanner. I came across your problem while dealing with the same issue. This way the sonarqube file went smoothly

2 Likes