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

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

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

我试过:

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

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


当前回答

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.

其他回答

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

因为我今天早上也遇到了这个问题,没有一个答案对我有帮助,尤其是在我的情况下。经过几个小时的努力,我终于找到了问题所在。

实际上,在故事板中工作时,我错误地重命名了我的“Main”。故事板“到”。并将其更改为“Main”。故事板解决了我的问题。

解决方案(根据我的问题):可能是你重命名了任何文件,因为xcode无法加载它,并提出了一个问题。 例如:如上文所述更改“可执行文件”名称的情况 可能的问题区域:可能是您使用的最后几个文件。

按下运行/停止按钮右侧所需按钮,选择方案菜单:


按编辑方案…:


选择你的可执行文件:

我也有类似的问题。显然我已经包含了信息。Plist从外部项目文件夹。这将导致相同的错误,在每次构建之后都会显示出来(除了我在清理项目后运行它之后)。

为了解决这个问题,我只需要包含信息。从项目文件夹Plist。

我从模拟器和设备两方面来研究这个问题。

这里有一个棘手的现象。如果我将项目复制到一个新位置,那么当我第一次运行时,这个问题就有可能消失。但当我打扫干净后,这个问题就来了。

我已经尝试了这个问题几乎所有的答案,但都没有。

在版本控制系统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”