每当我尝试在Xcode 6 Beta 4中运行我的应用程序时,我都会得到错误:

The file "MyApp.app" couldn't be opened because you don't have permission to view it.

无论我的目标是什么模拟器或设备,都会出现此错误。

我试过:

在Xcode中删除所有来自组织者的派生数据 正在修复驱动器上的权限 手动提升构建的MyApp.app的权限 重启电脑

有没有其他人遇到过这个问题并找到了解决方案?


当前回答

我遇到了AppDelegate缺失的问题。

创建一个最小值解决了这个问题:

import UIKit

@UIApplicationMain
final class AppDelegate: UIResponder,UIApplicationDelegate {
}

其他回答

我通过清除xcode中的首选项中的派生数据来解决这个问题

None of the provided answers worked for me. In my case, I finally fixed the error by updating the target architectures in Build Settings/Architectures/Valid Architectures to $(ARCHS_STANDARD), as arm64 was missing. This was not prohibiting the project to build, although a warning was issued recommending updating the valid architectures, but the "app could not be opened" error was shown at run time. I surmise this error is rather generic and not always linked with a permission issue, but may be displayed when the generated app package is invalid.

我有这个错误与我的一些旧的项目,我正在从橱柜出来更新。由于某些原因,在Xcode 6中使用旧代码似乎会导致这种情况。

我已经在我所做的所有项目中修复了这个问题:

删除派生数据 在产品:做清洁 进入项目目标中的构建设置,进入构建选项,并将“Compiler for C/ c++ /Objective-C”的值更改为“Default” 编译器”。

我会进入Xcode文档所在的文件夹,点击command + I来获取信息。在底部,点击锁以解锁文件夹以编辑权限。如果权限看起来不错,勾选“应用到附带文件夹”的复选框,让它来做它的事情。我个人没有见过这个,也不确定这是否是你在编辑构建权限时在你的帖子中所说的。

我有类似的问题(xCode 6.2)的示例代码下载。我试图在信息中将可执行名称设置为默认。但是这并没有起作用。

相反,将Compiler for C/ c++ /Objective-C更改为Default Compiler(Apple LLVM 6.0),而不是Unsupported Compiler(com.apple.compilers.llvmgcc42) for project。