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

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

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

我试过:

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

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


当前回答

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

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

其他回答

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中执行以下操作

窗口->组织者->项目->应用程序的问题->删除按钮在派生数据。

然后我清理了项目,瞧

作品

我的应用程序在XCode 9.4上运行良好,但当我在XCode 10中打开我的项目时,我遇到了这个问题。对我来说,问题在于构建设置。我在这个页面https://forums.developer.apple.com/thread/112141找到了答案。

简单地说,转到文件>工作空间设置…>构建系统,并将其更改为“遗留构建系统”

有时候在新版本的Xcode中打开旧项目会得到这个消息。

转到问题导航器,并遵循警告提示“更新到重新确认的设置”。

繁荣,神奇!

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