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

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

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

我试过:

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

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


当前回答

1)首先构建选项。

2)然后将“Compiler for C/ c++ /Objective-C”的值改为Default Compiler。

清洁和工作:-)

其他回答

对我来说,一个简单的产品->清洁工作很棒

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}

X-code 6.3.2

[构建设置]选项。 [所有]-[构建选项]-[C / c++ /Objective-C编译器]-[默认编译器(Apple LLVM 6.1)]

然后重新构建项目,它可以正常运行。

我所做的是:

我从项目中删除了VALIDARCHS 我从Target删除了VALIDARCHS 仅构建活动体系结构= YES(用于调试)体系结构 标准架构$(ARCHS_STANDARD)

另外,File ->项目/工作区设置==新建系统

Xcode版本12 (12A7209)