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

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

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

我试过:

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

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


当前回答

错误消息是通用的,实际上并没有告诉您它的真正含义。

对我来说,我必须恢复早期的github回归,这给:

armv7 armv7s arm64

对建筑。

其他回答

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

信息系统出了点问题。项目的Plist。我在Xcode 6 beta 4中创建了一个同名的新项目,然后替换了真实项目的信息。请用新的。然后,该项目建立并运行良好。

看看差异,看起来plist可能不知怎么搞混了游乐场的plist。捆绑包标识符是“com.apple.dt.playground”。iOS-18300-13”,可执行文件和捆绑包的名称是“iOS”以及其他一些奇怪的名称。

这是完整的差异,以防有人需要参考:

        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
-       <string>iOS</string>
+       <string>${EXECUTABLE_NAME}</string>
        <key>CFBundleIdentifier</key>
-       <string>com.apple.dt.playground.iOS-18300-13</string>
+       <string>com.myCompany.${PRODUCT_NAME:rfc1034identifier}</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
-       <string>iOS</string>
+       <string>${PRODUCT_NAME}</string>
        <key>CFBundlePackageType</key>
-       <string>AAPL</string>
+       <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
-       <key>CFBundleSupportedPlatforms</key>
-       <array>
-               <string>iPhoneSimulator</string>
-       </array>
+       <key>CFBundleSignature</key>
+       <string>????</string>
        <key>CFBundleVersion</key>
        <string>1</string>
-       <key>DTPlatformName</key>
-       <string>iphonesimulator</string>
-       <key>DTSDKName</key>
-       <string>iphonesimulator8.0</string>
-       <key>LSBackgroundOnly</key>
-       <true/>
        <key>LSRequiresIPhoneOS</key>
        <true/>
+       <key>UIMainStoryboardFile</key>
+       <string>Main</string>
        <key>UIRequiredDeviceCapabilities</key>
        <array>
                <string>armv7</string>
        </array>
+       <key>UISupportedInterfaceOrientations</key>
+       <array>
+               <string>UIInterfaceOrientationPortrait</string>
+               <string>UIInterfaceOrientationLandscapeLeft</string>
+               <string>UIInterfaceOrientationLandscapeRight</string>
+       </array>
 </dict>
 </plist>

当路径不正确或试图获取文件夹的内容而不是路径时,也会出现此错误。

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.

我会进入Xcode文档所在的文件夹,点击command + I来获取信息。在底部,点击锁以解锁文件夹以编辑权限。如果权限看起来不错,勾选“应用到附带文件夹”的复选框,让它来做它的事情。我个人没有见过这个,也不确定这是否是你在编辑构建权限时在你的帖子中所说的。