4
votes

When run the unit test on my iPad, I get the error as below(Xcode7). Can someone facing same problem, how to solve it?

Code Coverage Data Generation Failed

Unable to retrieve the profile data files from 'iPad'.

Besides that, will also pop up the message as below:

Setting up profile generation failed

Xcode could not generate profile information for bundle identifier (com.xxxx.merchant). The profile path was missing. The environment variables were valid.

2
I don't have a full solution, but I've been able to temporarily work around this by restarting the device.dpassage
Yes, it work after restart the device. Thanksuser831098
But the bugs still will appear again. Hope someone can help for better solution.user831098

2 Answers

7
votes

1.Edit your project scheme->Test->Info->deselect "Gather coverage data"

2.Product Clean, also clean build folder

3.Close Xcode, restart Xcode

4.delete app on your device and restart your device(might be optional)

There appears to have bug with code coverage, hence the key to bypass this bug is to disable "Gather coverage data" for now, hope this helps.

1
votes

The above didn't work for me. However, I noticed that my KIF.framework wasn't getting loaded, so the test target was actually not getting properly built.

Fixing the issue with the framework file also fixed the issue with the test coverage for me.