每当我尝试在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 Beta 4中运行我的应用程序时,我都会得到错误:
The file "MyApp.app" couldn't be opened because you don't have permission to view it.
无论我的目标是什么模拟器或设备,都会出现此错误。
我试过:
在Xcode中删除所有来自组织者的派生数据 正在修复驱动器上的权限 手动提升构建的MyApp.app的权限 重启电脑
有没有其他人遇到过这个问题并找到了解决方案?
当前回答
我把名字改成了新名字,然后我把旧名字还给了我的项目,这对我很有帮助。
其他回答
我从模拟器和设备两方面来研究这个问题。
这里有一个棘手的现象。如果我将项目复制到一个新位置,那么当我第一次运行时,这个问题就有可能消失。但当我打扫干净后,这个问题就来了。
我已经尝试了这个问题几乎所有的答案,但都没有。
在版本控制系统git的帮助下,我可以检查出以前版本的代码,并查看哪些修改导致了这个问题。
在我的项目中,HEAD版本是可行的,我最新的umcommitted修改将导致这个问题。
因此,我检出我的代码的可行版本中的每个文件,以定位问题。当我签出coin.xcodeproj/project时。Pbxproj(硬币是我的应用程序名称),这个问题已经解决了。
解决方案:签出可工作的coin.xcodeproj/project。pbxproj,对于我的情况下,我只是使用HEAD版本是可以的。
git checkout HEAD coin.xcodeproj/project.pbxproj
总结一下:
project.pbxproj: checkout the workable project.pbxproj file. Build Options: set Compiler for C/C++/Objective-C to default compiler. Executable file: set to $(EXECUTABLE_NAME) or directly set to your app name. Build > Clean:just do a clean. Replace the Info.plist with a new file from a new project Duplicate Info.plist in the project: just remove the extra one. Derived Data.: Find the Derived data path by Xcode->preference->locations->Derived data, then delete it with rm -r /Users/roofe/Library/Developer/Xcode/DerivedData And there may other reasons, you can refer to “The file ”MyApp.app“ couldn't be opened because you don't have permission to view it”
我最近在Xcode 6.0.1中运行一个旧项目(最初创建于Xcode 4.x)时遇到了同样的问题。
我通过将“建筑设置”中的“架构”更改为默认值来解决这个问题,即“标准架构(armv7,arm64)”。
希望这能帮助到有类似问题的人:)
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.
我自己修复了在“arm32”和“arm64”架构之间切换的问题。从“构建设置”中,我将“架构”和“有效架构”从“arm32”修改为“arm64”,它工作了。在改变了一些其他设置后,在arm32和arm64之间切换不再有区别,所以我怀疑这是否是路由原因。
之前我尝试了这里的所有其他建议:
Plist未被修改 EXECUTIBLE_NAME未被修改 构建清洁 删除DerivedData 默认的编译器
我也遇到过类似的问题。不知何故,我的值键可执行文件混淆了。只需将其更改回${EXECUTABLE_NAME}(在您的项目> Info下)。为我工作!