Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Device Debugging

Is it possible to actually use the Xcode debugger when running an iPhone app on the device rather than the simulator? i.e., can I have the device stop at breakpoints that I set in my code and step through the code as it runs on the device?

EDIT: I should mention that I am a registered developer with Apple and have a valid certificate. In fact, I can build and run iPhone applications on my device just fine. However, even in Debug mode, my application will not stop on breakpoints or output to the console when I run it on my device. If it helps, my application will function normally in debug mode (e.g., stopping at breakpoints) when I run in the simulator.

EDIT 2: I've tried resetting my phone, completely removing and reinstalling Xcode, creating a new project, changing all the settings mentioned in the answers on this page (as well as others), cleaning and building my project, Build and Debug... If I click Pause, it says "Error from Debugger: Quit". :( Maybe I'll try to debug on this device using Xcode on another computer and see what happens.

EDIT 3: Well, I tried using another computer using a fresh install of Xcode in a new project, and I still can't get device debugging to work. I have a suspicion that it's my iPhone or cable perhaps? I'd like to think that I'm not so incompetent that I've missed something so embarrassingly obvious, but I've double- and triple-checked all of the suggestions mentioned here.

EDIT 4: FINALLY got device debugging to work. I have a feeling that something low-level on my device was causing issues...nothing I did worked on my system. However, I installed Xcode on another system and device debugging on the same device (with the same cable) worked flawlessly. Directly after that, device debugging began working on my original machine, leading me to believe that some strange hardware flag was screwed up and somehow "reset" on the second machine. In any case, it works now... Thanks for all the help. :)

Also, I'm unsure if it's better to leave this question unanswered or pick the most "helpful" answer...

like image 617
CIFilter Avatar asked Jun 11 '09 21:06

CIFilter


People also ask

What is debugging mode on iPhone?

When troubleshooting an issue that cannot be resolved right away, you may be asked to enable debug mode to give the YouMail support team additional data logs. Once enabled, you will have to replicate the issue so it is logged and then submit the log which will go directly to our app developers.

How do I view iOS device logs?

Connect your iOS to your computer with a USB or Lightning cable. Go to Window > Devices and select your device from the list. Click the "up" triangle at the bottom left of the right hand panel. All logs from all apps on the device will be displayed here.

What happens when you debug your phone?

When a device is in USB Debugging mode, a computer connected to the device can read all data, run commands, and install or remove apps. The security of the device settings and data could be compromised.


2 Answers

Yes -- just use a device build. You have to get certificates and provision it.

This is a good description:

http://boga.wordpress.com/2008/07/16/debugging-ipod-provision-profilescertificates/

like image 174
Lou Franco Avatar answered Oct 10 '22 07:10

Lou Franco


Make sure to start debugging by pressing "Cmd-Y"... and not "Cmd-R" :-)

like image 38
MrDatabase Avatar answered Oct 10 '22 08:10

MrDatabase