每当我尝试在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的权限 重启电脑
有没有其他人遇到过这个问题并找到了解决方案?
当前回答
检查项目文件夹的读写权限(在Finder >中右键单击项目文件夹获取信息)
其他回答
信息系统出了点问题。项目的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>
因为我今天早上也遇到了这个问题,没有一个答案对我有帮助,尤其是在我的情况下。经过几个小时的努力,我终于找到了问题所在。
实际上,在故事板中工作时,我错误地重命名了我的“Main”。故事板“到”。并将其更改为“Main”。故事板解决了我的问题。
解决方案(根据我的问题):可能是你重命名了任何文件,因为xcode无法加载它,并提出了一个问题。 例如:如上文所述更改“可执行文件”名称的情况 可能的问题区域:可能是您使用的最后几个文件。
请检查是否添加了任何第三方lib与plist。有些时候第三方lib有信息plist导致的问题。
我自己修复了在“arm32”和“arm64”架构之间切换的问题。从“构建设置”中,我将“架构”和“有效架构”从“arm32”修改为“arm64”,它工作了。在改变了一些其他设置后,在arm32和arm64之间切换不再有区别,所以我怀疑这是否是路由原因。
之前我尝试了这里的所有其他建议:
Plist未被修改 EXECUTIBLE_NAME未被修改 构建清洁 删除DerivedData 默认的编译器
好吧,在我的情况下,我只是重命名捆绑名称和可执行文件的信息值。Plist与项目名称相同。这对我很管用。