Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-14-2012, 03:44 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Question Debug on Device?

How can debug my app while it's running on a real device?

I'm testing my app on a iPod touch, and it's doing something unexpected, not seen on the simulator.
samurle is offline   Reply With Quote
Old 01-14-2012, 06:09 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by samurle View Post
How can debug my app while it's running on a real device?

I'm testing my app on a iPod touch, and it's doing something unexpected, not seen on the simulator.
Set up for a debug build. Connect the iPod connector to your device. Select the device as the target. Set breakpoints as needed. Run.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-14-2012, 07:10 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Question

Quote:
Originally Posted by Duncan C View Post
Set up for a debug build. Connect the iPod connector to your device. Select the device as the target. Set breakpoints as needed. Run.
Thanks, but when I do that, XCode4 gives me a dialog error:
Quote:
Error Starting Executable
Error launching remote program: failed to get the task for process 2239.
I have to tap on the app icon myself to run it, and it runs ok from there, but then, no debug text
gets sent to the XCode4 Debug Window.

Are you implying that I should see debug text in the Debug Window?
samurle is offline   Reply With Quote
Old 01-14-2012, 07:27 PM   #4 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by samurle View Post
Thanks, but when I do that, XCode4 gives me a dialog error:


I have to tap on the app icon myself to run it, and it runs ok from there, but then, no debug text
gets sent to the XCode4 Debug Window.

Are you implying that I should see debug text in the Debug Window?
Yes. That error means something is wrong. Try building one of the empty template apps from Xcode. If that doesn't work, reboot your Mac and your phone/iPad, and try again. Sometimes the debugger gets a task stuck in an indeterminate state, and the only way to fix it is to reboot your Mac. (Ok, you could probably fix it in terminal or Activity Monitor if you knew the gory details of the debugger and all the deamons and black magic that make the debugger work.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 01-14-2012, 08:04 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Unhappy

Quote:
Originally Posted by Duncan C View Post
Yes. That error means something is wrong. Try building one of the empty template apps from Xcode. If that doesn't work, reboot your Mac and your phone/iPad, and try again. Sometimes the debugger gets a task stuck in an indeterminate state, and the only way to fix it is to reboot your Mac. (Ok, you could probably fix it in terminal or Activity Monitor if you knew the gory details of the debugger and all the deamons and black magic that make the debugger work.
Thanks, it seems I've been having this problem since the very first day I tried
running my app on a real device. I've tried deleting, cleaning, restarting,
re-connecting my app, but the error remains.

I did not realize this was preventing me from seeing debug output. I guess
I have to find a way to getting it working or else!

I have my project set to debug release. Code signing is set to iPhone Distribution.
I have both development and ad hoc distribution profiles installed in Organizer.
Bundle identifier is set correctly.

Not sure what else to do.
samurle is offline   Reply With Quote
Old 01-14-2012, 08:29 PM   #6 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Default

Quote:
Originally Posted by samurle View Post
Thanks, it seems I've been having this problem since the very first day I tried
running my app on a real device. I've tried deleting, cleaning, restarting,
re-connecting my app, but the error remains.

I did not realize this was preventing me from seeing debug output. I guess
I have to find a way to getting it working or else!

I have my project set to debug release. Code signing is set to iPhone Distribution.
I have both development and ad hoc distribution profiles installed in Organizer.
Bundle identifier is set correctly.

Not sure what else to do.
Found an official answer to my problem:
developer.apple.com/library/ios/#qa/qa1682/_index.html
Loading…

Still working on it.
samurle is offline   Reply With Quote
Old 01-14-2012, 09:21 PM   #7 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 245
samurle is on a distinguished road
Default

Finally got it working! Thanks for the help!

It was a code signing issue with the wrong profile.

Development profiles have the Entitlement key "get-task-allow" set to true,
while Ad-Hoc distribution profiles have the Entitlement key "get-task-allow" set to false.

The "get-task-allow" key decides whether a debugger can be attached or not.

These profile files are binary, but you can open them with TextEdit, and see the
embedded Entitlement keys. I don't think they can be edited by hand.

Anyway, I have to set my code signing to "iPhone Developer" instead of "iPhone Distribution".
Problem fixed!
samurle is offline   Reply With Quote
Reply

Bookmarks

Tags
debug, device

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 389
10 members and 379 guests
7twenty7, Atatator, glenn_sayers, guusleijsten, iphonedevshani, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:42 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0