每当我尝试在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 GM,我遇到了同样的问题。 我所做的是去构建设置->构建选项(你可以搜索“编译器”), 然后将“Compiler for C/ c++ /Objective-C”的选项改为默认编译器。

其他回答

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

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

繁荣,神奇!

因为我今天早上也遇到了这个问题,没有一个答案对我有帮助,尤其是在我的情况下。经过几个小时的努力,我终于找到了问题所在。

实际上,在故事板中工作时,我错误地重命名了我的“Main”。故事板“到”。并将其更改为“Main”。故事板解决了我的问题。

解决方案(根据我的问题):可能是你重命名了任何文件,因为xcode无法加载它,并提出了一个问题。 例如:如上文所述更改“可执行文件”名称的情况 可能的问题区域:可能是您使用的最后几个文件。

我能够从xcode 6.1之前的备份中恢复我的项目,

一旦我从不同的目录打开我的工作空间,我就能够运行我的目标而不会出现这个错误。 模拟器现在也可以正常工作了。

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.

对我来说,错误是在文件信息。plist, field Bundle标识符。不知怎的,它被修改成了

com.myCompany。$ {PRODUCT_NAME: rfc1034identifier}

com.myCompany。$ {PRODUCT_NAME}