views:

220

answers:

2

Hey everybody.

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.

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:

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

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.

Thanks in advance for helping me on this.

Update

So, after looking around I found this on the device console in the 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

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.

+1  A: 

First, look here: 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-allow is checked in 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.

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.

iWasRobbed
Thanks for the answer - you're right: The DP2 is awesome :)Re-creating the profiles and reinstalling them was my first attempt at fixing this - so yes, I've tried that already. The get-task-allow key in the Entitlements-plist is turned on as well. I looked at the blog post you linked to and all my IDs are the same.
the_rob
Is your phone jailbroken? 0xE8008001 is showing up in a lot of google hits as being an issue only on jailbroken phones.
iWasRobbed
Yes, I noticed that too :)Nope, its not jailbroken and its not been tempered with in any kind.
the_rob
Hmmm, I'm stumped then. If you say it started with iOS4 you might wanna try restoring or re-installing (especially if you don't have 4.0.1 yet). These kind of bugs irritate the heck out of me. Sorry I couldn't be of more help!
iWasRobbed
Hey, no worries. I am grateful. I got a little further in the debugging process (posted an update to the initial question). My guess now is that its a problem with the code signing.
the_rob
+1  A: 

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

From the Xcode 4 readme:

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.

Steve Madsen
Hi Steve, thanks for the anwser. Though I have indeed not read that passage I should have noted that I did try to deploy my app through XCode 3.2.4 as well. It yielded the same result unfortunately.
the_rob
I see you solve your problem already, but I'll point out that Xcode 3.2.4 is the iOS 4.1 beta and also not meant for distribution builds.
Steve Madsen
I'll keep that in mind - thanks.
the_rob