Fixing Broken Pipes

pipewrenchThere’s nothing like the simulator for putting your app together quickly. It’s better than debugging on the device for one main reason: it’s fast! Starting up the app is fast. Debugging the app is fast. Everything is fast.

But sometimes you just need to slow down. By using the device. Of course, I was testing on the device today and made a critical error.

I couldn’t figure out what was wrong. I was getting error messages in the debugger console like this:

putpkt: write failed: Broken pipe

Or this:

mem 0×1000 0×3fffffff cache
mem 0×40000000 0xffffffff none
mem 0×00000000 0×0fff none

Or even like this:

Sent: [1251990710.449:32] +
Sent: [1251990710.449:32] Hc-1
Recvd: [1251990710.454:32] OK
Sent: [1251990710.455:32] qC
Recvd: [1251990710.460:32] QC0
Sent: [1251990710.460:32] qStepPacketSupported
Recvd: [1251990710.463:32] OK
Sent: [1251990710.478:49] QEnvironment:SHELL=/bin/bash
Recvd: [1251990710.481:49] OK
Sent: [1251990710.481:49] QEnvironment:TMPDIR=/var/folders/UF/UFCJNauIGPu+F7L7bsqhZU+++TI/-Tmp-/
Recvd: [1251990710.485:49] OK
Sent: [1251990710.485:49] QEnvironment:Apple_PubSub_Socket_Render=/tmp/launch-o19tpZ/Render
Recvd: [1251990710.488:49] OK
etc…..

It was quite frustrating.

So I looked around on the forums, and there were several questions about these errors, many of which went unanswered. (Forums can only get you so far sometimes.) But eventually I found the answer: you can’t debug your program if you’re using an ad hoc profile.

So I used the appropriate profile, and now I debug to my heart’s content. iPhone development seems to be straining with this kinds of gotchas. I just hope I remember this solution next time I find this problem. Writing it down will help, I hope! :)

Leave a Comment