Xcode 7 - Code coverage data generation failed

前端 未结 19 2760
無奈伤痛
無奈伤痛 2020-12-25 09:32

When I run my tests I get an error:

Code coverage data generation failed.
Unable to retrieve the profile data files from \'UIDevice\'.

19条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 10:24

    If you are using cocoa pods, check this thread on the Cocoapods repository: https://github.com/CocoaPods/CocoaPods/issues/5385#issuecomment-226269847

    This fixed my problem:

    Copying @dfleming response:

    For some reason, it appears that CocoaPods is not adding the "[CP] Embed Pods Frameworks" build phase to the UI Tests target when generating the project workspace.

    I manually added this in and the UI Tests were runnable again.

    This build phase should run the following script: (Replace {YourProject} with your project name)

    "${SRCROOT}/Pods/Target Support Files/Pods-{YourProject}UITests/Pods-{YourProject}UITests-frameworks.sh"

提交回复
热议问题