简体   繁体   English

iOS模拟器无法安装应用程序

[英]iOS Simulator failed to install application

My Xcode project started to give "iOS Simulator failed to install the application" 我的Xcode项目开始给“iOS模拟器无法安装应用程序”

I'm using iOS Simulator 7.1. 我正在使用iOS模拟器7.1。 The simulator runs any other project. 模拟器运行任何其他项目。 I've read other entries in stack overflow and I've tried to delete ~/Library/Application Support/iPhone Simulator from terminal, reset from "iOS Simulator/Reset Content and Settings" menu, shutdown and restart Maverick but result was the same. 我已经读过堆栈溢出中的其他条目,我试图从终端删除〜/ Library / Application Support / iPhone Simulator,从“iOS模拟器/重置内容和设置”菜单重置,关闭并重启Maverick但结果是一样的。

Help please! 请帮忙!

Update: When I try to upload my application to a real device I got this error: "Could not inspect the application package." 更新:当我尝试将我的应用程序上传到真实设备时,我收到此错误:“无法检查应用程序包。”

I think this error is related to above error. 我认为这个错误与上述错误有关。

When I check system.log entries I found below lines: 当我检查system.log条目时,我发现下面的行:

...

05/05/14 00:04:48,507 Xcode[1534]: AMDeviceSecureTransferPath (thread 0x10bd96000): disableDelta: FALSE
05/05/14 00:04:48,606 Xcode[1534]: AMDeviceSecureTransferPath (thread 0x10bd96000): Using delta for package at path    file:///Users/serkan/Library/Developer/Xcode/DerivedData/myapp-efvftyvllnqdibctwpfggqgjpfzk/Build/Products/Debug-iphoneos/myapp.app/ ID is myapp.myapp
05/05/14 00:04:48,640 Xcode[1534]: AMDeviceStartHouseArrestService (thread 0x10bd96000):  There was an error from the device: ApplicationLookupFailed
05/05/14 00:04:48,650 Xcode[1534]: AMDeviceSecureTransferPath (thread 0x10bd96000): AMDeviceSecureTransferPath:1589 starting delta_transfer_directory, ref_afc: 0x0
05/05/14 00:04:50,642 Xcode[1534]: AMDeviceSecureTransferPath (thread 0x10bd96000): AMDeviceSecureTransferPath:1592 finished delta_transfer_directory
05/05/14 00:04:50,716 Xcode[1534]: call_and_response (thread 0x10bd96000): GOT AN ERROR 0xe8000051
05/05/14 00:04:50,716 Xcode[1534]: perform_command (thread 0x10bd96000): There was an error communicating with the service agent: 0xe8000051
05/05/14 00:04:50,717 Xcode[1534]: AMDeviceSecureInstallApplication (thread 0x10bd96000): Old style install failed for (PublicStaging/myapp.app)
05/05/14 00:04:50,717 Xcode[1534]: AMDeviceSecureInstallApplication (thread 0x10bd96000): Could not install package on device: kAMDPackageInspectionFailedError

Do you have a folder named Resource or Resources? 你有一个名为资源或资源的文件夹吗? Rename that to a different name and try again. 将其重命名为其他名称,然后重试。 (Remember to clean the project.) (记得清理项目。)

EDIT: If this does not fix it, look at the project settings, there under "Build phases" and there under "Copy Bundle Resources". 编辑:如果这不能修复它,请查看项目设置,在“构建阶段”下,在“复制捆绑资源”下。 Maybe a stale entry sits there and needs to be removed manually. 也许过时的条目就在那里,需要手动删除。

EDIT: Also clean the project. 编辑:同样清理项目。 Hold the option key when clicking on the menu entry so it says "Clean Build Folder...". 单击菜单条目时按住选项键,使其显示“Clean Build Folder ...”。 If necessary, remove the derived data: Open Organizer, select your project: There is an entry "Derived Data" which shows the path to the files generated by Xcode. 如有必要,删除派生数据:打开管理器,选择项目:有一个条目“派生数据”,显示Xcode生成的文件的路径。 Right to that is also a Delete button - click that to delete all the derived data. 权利也是一个删除按钮 - 单击该按钮删除所有派生数据。 (Xcode will have to rebuild index files etc., nothing critical) (Xcode必须重建索引文件等,没什么关键)

(I remember, that I saw such errors when I had a Resource(s) folder and when I renamed it, it worked again. As far as I understood, Resource is used for Mac OS X apps. I assumed it would not be used for iOS, but at least it caused trouble in my case.) (我记得,当我有一个Resource(s)文件夹时,我看到了这样的错误,当我重命名它时,它再次起作用。据我所知,Resource用于Mac OS X应用程序。我认为它不会被使用对于iOS,但至少它在我的情况下造成了麻烦。)

The problem is resolved for me by deleting: 通过删除以下问题解决了我的问题:

~/Library/Application Support/iPhoneSimulator

folder and re-installing xcode . 文件夹并重新安装xcode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM