XCode 无法将 iPhone 应用程序部署到 iPhone 3GS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3364434/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:34:59  来源:igfitidea点击:

XCode fails to deploy iPhone app to iPhone 3GS

iphonexcodedeploymentxcode4

提问by the_rob

So I built my iPhone app and it runs fine in the simulator so I wanted to deploy it to my iPhone for one last testing round before I go into open beta testing wiht my distribution profile. I did this numerous times already and it has never been a problem. However since the last test run I upgraded both my iPhone (iOS 4) and XCode (Version 4 DP2) so maybe the problem is rooted there.

所以我构建了我的 iPhone 应用程序,它在模拟器中运行良好,所以我想将它部署到我的 iPhone 上进行最后一轮测试,然后再使用我的分发配置文件进行公开 beta 测试。我已经多次这样做了,这从来都不是问题。然而,自从上次测试运行以来,我升级了我的 iPhone(iOS 4)和 XCode(版本 4 DP2),所以问题可能出在那里。

The build process runs fine and successful - after that XCode tries to deploy it to my iPhone and fails with a simple "An unknown error has occured". Stumped by this I took a look in the system.log and here is what it says:

构建过程运行良好且成功 - 之后 XCode 尝试将其部署到我的 iPhone 并失败并显示一个简单的“发生未知错误”。被这个难住了,我查看了 system.log,这是它所说的:

Jul 29 17:44:18 Xcode[12893]: AMDeviceStartHouseArrestService (thread 0x120e8e000): There was an error from the device: ApplicationLookupFailed

Jul 29 17:44:19 Xcode[12893]: call_and_response (thread 0x120e8e000): GOT AN ERROR 0xe800003a

Jul 29 17:44:19 Xcode[12893]: perform_command (thread 0x120e8e000): There was an error communicating with the service agent: 0xe8008001

Jul 29 17:44:19 Xcode[12893]: AMDeviceSecureInstallApplication (thread 0x120e8e000): Could not install package on device: e8008001

Jul 29 17:44:19 Xcode[12893]: Result for ‘/SourceCache/DTDeviceKit/DTDeviceKit-232.24/DTDeviceKit/DTDeviceKit_Utilities.m' at 468 : 0xE8008001

Jul 29 17:44:19 Xcode[12893]: Result for ‘/SourceCache/IDEiPhoneSupport/IDEiPhoneSupport-45/Classes/DVTiPhoneMobileDeviceIO.m' at 265 : 0xE8008001

7 月 29 日 17:44:18 Xcode[12893]:AMDeviceStartHouseArrestService(线程 0x120e8e000):设备出现错误:ApplicationLookupFailed

7 月 29 日 17:44:19 Xcode[12893]:call_and_response(线程 0x120e8e000):出现错误 0xe800003a

7 月 29 日 17:44:19 Xcode[12893]:perform_command(线程 0x120e8e000):与服务代理通信时出错:0xe8008001

7 月 29 日 17:44:19 Xcode[12893]:AMDeviceSecureInstallApplication(线程 0x120e8e000):无法在设备上安装包:e8008001

7 月 29 日 17:44:19 Xcode[12893]:468 处“/SourceCache/DTDeviceKit/DTDeviceKit-232.24/DTDeviceKit/DTDeviceKit_Utilities.m”的结果:0xE8008001

7 月 29 日 17:44:19 Xcode[12893]:'/SourceCache/IDEiPhoneSupport/IDEiPhoneSupport-45/Classes/DVTiPhoneMobileDeviceIO.m' 在 265 处的结果:0xE8008001

As I am guessing this is a rather uncommon problem (hence the "unknown error") I would be very grateful for any pointers on how to go about debugging this thing. I don't expect a solution or anything (though I would be grateful if anybody encountered a similar problem and helped me out with an exact solution ;)) but maybe some of you have a good idea.

因为我猜这是一个相当不常见的问题(因此是“未知错误”),我将非常感谢有关如何调试这个东西的任何指示。我不希望有解决方案或任何东西(尽管如果有人遇到类似的问题并帮助我找到确切的解决方案,我将不胜感激;))但也许你们中的一些人有一个好主意。

Judging by the two lines in the log stating that there was an error from the device and in the communication with the service agent I am guessing it might be a problem in the connection to the iPhone itself - but seeing that synching with iTunes and all the "normal" stuff works just fine I cannot figure out what that problem might be.

从日志中的两行来看,设备和与服务代理的通信出现错误,我猜这可能是与 iPhone 本身的连接出现问题 - 但看到与 iTunes 和所有同步“正常”的东西工作得很好,我无法弄清楚那个问题可能是什么。

Thanks in advance for helping me on this.

在此先感谢您帮助我。

Update

更新

So, after looking around I found this on the device console in the XCode Organizer:

因此,环顾四周后,我在 XCode Organizer 的设备控制台上发现了这个:

Thu Jul 29 22:40:00 Roberts-3GS SCHelper[38] : 0x104e60 {port = 0x382b, caller = SpringBoard(42):com.apple.preferences, path = /Library/Preferences/SystemConfiguration/preferences.plist}

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : unrecognized status -25293 from codesigning library

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 verify_signer_identity: Could not copy validate signature: -402620415

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 preflight_application_install: Could not verify executable at /var/tmp/install_staging.0DuNfz/landu.app

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 install_application: Could not preflight application install

Thu Jul 29 22:40:22 Roberts-3GS mobile_installation_proxy[961] : handle_install: Installation failed

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 handle_install: API failed

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 send_message: failed to send mach message of 64 bytes: 10000003

Thu Jul 29 22:40:22 Roberts-3GS installd[960] : 00503000 send_error: Could not send error response to client

7 月 29 日星期四 22:40:00 Roberts-3GS SCHelper[38] : 0x104e60 {port = 0x382b, caller = SpringBoard(42):com.apple.preferences, path = /Library/Preferences/SystemConfiguration/preferences.plist}

星期四 7 月 29 日 22:40:22 Roberts-3GS 已安装 [960]:来自代码签名库的无法识别状态 -25293

7 月 29 日星期四 22:40:22 Roberts-3GS 已安装 [960]:00503000 verify_signer_identity:无法复制验证签名:-402620415

7 月 29 日星期四 22:40:22 Roberts-3GS 已安装 [960]:00503000 preflight_application_install:无法在 /var/tmp/install_staging.0DuNfz/landu.app 验证可执行文件

7 月 29 日星期四 22:40:22 Roberts-3GS 已安装 [960]:00503000 install_application:无法预检应用程序安装

星期四 7 月 29 日 22:40:22 Roberts-3GS mobile_installation_proxy[961]:handle_install:安装失败

7 月 29 日星期四 22:40:22 Roberts-3GS 已安装 [960]:00503000 handle_install:API 失败

7 月 29 日星期四 22:40:22 Roberts-3GS 已安装 [960]:00503000 send_message:无法发送 64 字节的 mach 消息:10000003

星期四 7 月 29 日 22:40:22 Roberts-3GS 已安装 [960]:00503000 send_error:无法向客户端发送错误响应

So it seems the iPhone was not able to validate the signature of the code signing. I guess I will re-create some certificates and try again tomorrow. I'll let you know how it turns out.

因此,iPhone 似乎无法验证代码签名的签名。我想我会重新创建一些证书,然后明天再试一次。我会让你知道结果如何。

采纳答案by iwasrobbed

First, look here: http://9mmedia.com/blog/?p=229

首先,看这里:http: //9mmedia.com/blog/?p=229

Then:

然后:

Have you tried re-creating a provisioning profile and re-installing it and then syncing with iTunes? Also, make sure your get-task-allowis checked in Entitlements.plist

您是否尝试过重新创建配置文件并重新安装它,然后与 iTunes 同步?另外,请确保您get-task-allow已在 Entitlements.plist 中检查

From another post:

来自另一个帖子:

get-task-allow, when signed into an application, allows other processes (like the debugger) to attach to your app. Distribution profiles require that this value be turned off, while development profiles require this value to be turned on (otherwise Xcode would never be able to launch and attach to your app). <-- Not sure if this last part is true anymore.

get-task-allow 在登录应用程序时允许其他进程(如调试器)附加到您的应用程序。分发配置文件要求关闭此值,而开发配置文件要求打开此值(否则 Xcode 将永远无法启动并附加到您的应用程序)。<-- 不确定这最后一部分是否是真的。

I've done both of what you described with updating to iOS4 and also XCode4 DP2 (which is awesome by the way), and have not had this issue. Sounds like either a bad install or something got corrupted or misplaced along the way.

我已经完成了您所描述的更新到 iOS4 和 XCode4 DP2(顺便说一句,这很棒)的描述,并且没有遇到此问题。听起来像是安装不正确或安装过程中损坏或放错了位置。

回答by Steve Madsen

Xcode 4 is not to be used for distribution builds. You need to build on Xcode 3.2.3 for that.

Xcode 4 不用于分发版本。为此,您需要在 Xcode 3.2.3 上构建。

From the Xcode 4 readme:

来自 Xcode 4 自述文件:

PLEASE NOTE: Xcode 4 is beta software. Continue to use Xcode 3.2.x for production development. This release of Xcode 4 is compatible with Xcode 3.2.x project files.

请注意:Xcode 4 是测试版软件。继续使用 Xcode 3.2.x 进行生产开发。此版本的 Xcode 4 与 Xcode 3.2.x 项目文件兼容。