xcode LLVM 配置文件错误:无法写入文件“default.profraw”:权限被拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47155543/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:25:17  来源:igfitidea点击:

LLVM Profile Error: Failed to write file "default.profraw": Permission denied

xcodellvm

提问by Cloud9999Strife

I'm getting the error LLVM Profile Error: Failed to write file "default.profraw": Permission deniedafter running unit tests in Xcode. I don't know where Xcode is trying to write this file to.

LLVM Profile Error: Failed to write file "default.profraw": Permission denied在 Xcode 中运行单元测试后出现错误。我不知道 Xcode 试图将这个文件写入到哪里。

What folder should I grant permissions for?

我应该授予哪个文件夹的权限?

回答by kasyanov-ms

Had this warning when I forgot to enable code coverage:

当我忘记启用代码覆盖率时出现此警告:

enter image description here

在此处输入图片说明

回答by muhasturk

Xcode 10+

Xcode 10+

Enable Code Coverage for Test scheme.

为测试方案启用代码覆盖率。

enter image description here

在此处输入图片说明

回答by EndersJeesh

This may not be helpful to anyone else, but I was hitting this when I had placed a exit(EXIT_FAILURE)in my code while refactoring a piece of code. I had assumed putting it in would crash the app right there and show me that it crashed there, but instead it was giving me this error and not showing where it had crashed.

这可能对其他人没有帮助,但是当我exit(EXIT_FAILURE)在重构一段代码时将 a放入我的代码时,我遇到了这个问题。我原以为把它放进去会使应用程序在那里崩溃并告诉我它在那里崩溃了,但它却给了我这个错误并且没有显示它崩溃的地方。

回答by John Pavley

Cleaning my build folder eliminated the error for me. (Option-Shift-Command K.) I'm using Xcode Version 9.2 (9C40b). The error started when I added a set of images to my Assets.xcassets. After a full clean the error is gone.

清理我的构建文件夹消除了我的错误。(Option-Shift-Command K.)我使用的是 Xcode 版本 9.2 (9C40b)。当我将一组图像添加到 Assets.xcassets 时,错误就开始了。完全清洁后,错误消失了。

回答by Coder-256

Try setting CLANG_ENABLE_CODE_COVERAGE = NOin your build settings for the target being tested and the tests themselves.

尝试CLANG_ENABLE_CODE_COVERAGE = NO在您的构建设置中为正在测试的目标和测试本身进行设置。

Edit: Please see the answer by @kasyanov-ms.

编辑:请参阅@kasyanov-ms 的答案。

回答by Sirens

Xcode 11 beta 1:

Xcode 11 测试版 1:

This is a known issue when attempting to use code coverage against simulator targets. You must either use a later beta or run coverage against a physical device.

这是尝试对模拟器目标使用代码覆盖率时的一个已知问题。您必须使用更高版本的测试版或针对物理设备运行覆盖。