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

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

无论我瞄准哪个模拟器或设备,都会出现此错误.

我试过:

  • 从Xcode中的Organizer中删除所有派生数据
  • 正在修复我的驱动器上的权限
  • 手动提升已构建MyApp的权限.应用程序
  • 重新启动我的电脑

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

屏幕截图

推荐答案

信息有问题.项目的第一部分.我在Xcode 6 beta 4中创建了一个同名的新项目,然后替换了真实项目的信息.用新的开始吧.该项目随后建成并运行良好.

看看这个差异,看起来这个plist可能与playground 的plist混淆了.Bundle 包的标识符是"com.apple.dt.playdy.iOS-18300-13",可执行文件和Bundle 包的名称是"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>

Swift相关问答推荐

WWDC Swift并发会话中的厨房服务示例令人困惑

如何在SwiftUI中创建具有圆角顶部和锯齿状底部边缘的自定义Shape,类似于撕破的纸?

如何在枚举有关联数据时使用combined if with case

是否可以将具有关联值的枚举强制转换为其类型与关联值匹配的变量?

使用`JSONSerialiser`时,省略通用可选项

从 Obj-C 函数返回 swift 类的不兼容指针类型

在 SwiftUI 中禁用 Select 器选项

If 语句在 Swift 中有 2 个日期

在领域 SwiftUI 异常中使用 Apple 登录:无法识别的 Select 器发送到实例

为什么即使 `C` 是一个不是 `Sendable` 的类,Task` 也能工作?

swiftui中服务端图片如何设计view并赋予rotationEffect?

如何在一个视图控制器中创建具有相同行为的多个集合视图?

Pod lib lint 命令找不到 watchos 模拟器

如何为 Swift UI 视图定义 struct ?

在 Swift 中强制崩溃的最简单方法

Swift:在子类中覆盖 == 导致仅在超类中调用 ==

否定 #available 语句

playground 导入:没有这样的模块Foo

类型myViewController不符合 Swift 中的协议 UIPIckerDataSource

如何判断 firebase 数据库值是否存在?