每当我尝试在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 8.2中也有同样的错误。我发现的原因是,另一个信息。Plist添加在我的项目中,同时添加库(手动复制)。

Xcode会因为选择正确的info。plist而感到困惑。

我只是删除了那个信息。Plist从添加的库。

然后它工作正常,没有任何权限警报。

好吧,在我的情况下,我只是重命名捆绑名称和可执行文件的信息值。Plist与项目名称相同。这对我很管用。

我发现在Build Options中将我的编译器更改为LLVM 6.0对我来说就足够了(xcode 6.1)

请检查是否已将可执行文件=> $(EXECUTABLE_NAME)更改为任何其他名称。如果您更改了此名称,则会显示此错误。请用$(EXECUTABLE_NAME)替换它。