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

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

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

我试过:

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

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


当前回答

为我解决这个问题的方法是将“仅构建活动架构”从“否”设置为“是”。

其他回答

我试了所有列出的答案,没有一个有用。问题是由于存在另一个plist文件通过cocoapods从子模块链接。幸运的是,这是我自己的模块,所以我只是从子模块项目中删除了这个plist,并重新安装了pods。

解决方案

后来我明白了问题的关键在于第二个plist的名称:简单地说,就是info.plist。您可以重命名文件并通过子模块的sources部分重新链接它

第二个plist文件有一个唯一的名字,所以Xcode不应该感到沮丧。甚至我的目标设置都指向一个主plist,而不是info.plist。看来Xcode对这个名字有特别的考虑

该错误在Xcode 6.4和Xcode 7.0中再现

What we didn't do right was to not apply with the accurate code when signing in the Build Settings. We fixed the issue up this way: Enter into Build Settings >> Code Signing >> Code Sign Identity. Then, apply with your iOS Developer ID for 'Debug', but be sure to apply with your iOS Distribution Profile for 'Release' We didn't apply correctly, so we couldn't have permission to ask for the App from the server, actually. Anyway this post forced us to revise all the parameters and requirements, so we pretty appreciate all your answers. Regards, T.

我遇到了AppDelegate缺失的问题。

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

import UIKit

@UIApplicationMain
final class AppDelegate: UIResponder,UIApplicationDelegate {
}

在我的情况下,它帮助只是关闭Xcode,修复权限与磁盘实用工具。只有在重新启动后,它才能像魔法一样工作。

我的解决方案是:

在你的终端输入: 打开~ /图书馆/开发/ CoreSimulator /设备/ 删除适当的文件夹 再次编译,它应该工作