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

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

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

我试过:

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

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


当前回答

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.

其他回答

我也遇到过类似的问题。不知何故,我的值键可执行文件混淆了。只需将其更改回${EXECUTABLE_NAME}(在您的项目> Info下)。为我工作!

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

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

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

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

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

我的天哪! !我花了几个小时来解决这个问题。

在XCode 7.3上,我的项目没有任何问题。

我错了

我只是添加了物理文件夹,并将我的文件移动到其中,问题开始了。

我什么都试过了

默认的编译器 清洁和构建 重置模拟器和重启模拟器,Xcode, iPhone甚至mac 更新Info.plist 删除派生数据 编辑项目文件夹的权限 检查我的架构

什么都没用:(

我是如何决定的

我是关于创建新项目,然后我只是删除那些物理 我添加的文件夹,干净的构建和是的!!

它的工作原理!

我的解决方案是:

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