Why is XCode Organizer console sometimes empty when I connect my iPhone - iphone

When testing my iPhone app I have found it incredibly useful to log information to the console window. I think it is amazing that I can send out an adhoc build to my co-workers and if they experience problems I am able to plug their iPhone into my mac and grab their console output. However, sometimes the console window is blank when we do this. Why is this the case? The code has been built with logging enabled. Besides that, it seems that the console output, when I see it, contains information about not only my app, but other iphone system logging.
Thanks for any insight you can provide.

It looks like if I restart XCode then the console gets populated properly. Must be a bug in XCode, but restarting seems to always work.

It seems to be a new bug in 3.2.3 - older versions worked fine.

Related

iPhone crash reports not found

i am trying to debug an Application I am developing using mono touch, but when I try to access Crash Reports in Xcode Organizer, I can't find any (and I know the app crashed at least 10 times).
I only see 5 files which process name is "Unknown".
I tried to locate the crash reports in
~/Library/Logs/CrashReporter/MobileDevice
But even there I couldn't find the reports.
Any ideas what Im missing?
Thanks!
Something similar happened to me before when I was trying to look at persistent connection logs, maybe it will be helpful to you. It turned out I was looking at /Library/Logs instead of ~/Library/Logs, the latter library folder is not visible but the former is.
I will suggest you to try and locate them in "Console" application and it shows hidden files by default. If Console cannot find them there should be a problem with logging.

Xcode says it cannot launch app when it in fact does run

What do I do about this?
Xcode launches the app on the device and it starts up, but when it has started the image below pops up and when I click "OK" it crashes the app.
The simulator has no issues, but I cannot read the console in regards to debugging because of this. There really is not a reason why this should be happening.
Also I have no idea what code could cause this. I have no errors or warnings and everything has been fine right up until yesterday.
If there is any code or more info you need to help me with this, please ask:-)
I have removed the app, restarted the devices and my mac.
Ok I found the answer here:
Same issue here
Basically you can't do debugging on a Ad-Hoc profile:-)

Xcode 4.2 not debugging properly

I've imported an iPhone app that I have developed for iOS and am now maintaining it. I've came across a couple of bugs when trying to add to the iPhone's calendar, which I'm happy to try and sort out myself with a bit of debugging.
One problem is that when I go to run the application on the iPhone simulator, it seems to run an older version of the app than the one I am running. I've removed and added another button since then and the old button is still showing when I run it in the simulator. However, when I compile and run this on a device, it loads the correct version and displays the correct version number in the 'about' view.
But... my main problem is that it doesn't seem to debug on the device properly. The app actually works fine except for the calendar problems, but if I put a few breakpoints in so I can see exactly where this is going wrong, it just doesn't seem to step through! The app pauses, and Xcode says the app has paused! I can press step over and continue execution etc and it appears to work, but I can't see it stepping over the code, nor can I hover over variables to see their values.
I've tried reinstalling Xcode multiple times (I did have a problem installing an older version, so I had to wait until the next version was available before Xcode would install).
The stress is: Today is my last day at work, and I'd really like to get this app ready for iOS 5 before I leave.
Has anyone seen these symptoms before? Is there a debug setting that I've missed? Or is it a corrupted installation?
I wish I could help people a bit with more information, but I don't even know where to start looking here. Any code I can post? any settings? (not too familiar with this, I'm a .NET guy usually).
Thanks!
Sorry you're going through a tough moment there Connell; as you said you're not too familiar with all this, I'm laying down a few steps which might help you out. Some are pretty basic, yes, but I've resolved to these steps myself several times when I've encountered similar scenarios;
If you're testing on the simulator, do a 'Reset Content and Settings' from the 'iOS Simulator' main menu. This will remove all old data and settings and give you a clean start.
Do a 'Clean All Targets' from the Build menu. Then go to your physical project folder and delete the Build folder from it altogether before starting to build again.
Restart both XCode and the Simulator (and your Mac too if possible)
Make sure the mode is set to Debug and not Release or Distribution
Even on the device, remove the old app before putting the new one in, and restart it for good measure.
Delete all Provisioning Profiles from the device and install just the one you need.
On the code;
I've noted that the app appears to 'pause' like this a couple of times when I had accidentally created an infinite loop in the code. Double check to see whether there's something which may cause this.
Unless you haven't already done so, throw an NSLog or two in there to see if its really not being executed beyond the breakpoint.
I've had the exact same problem with a project that I started on xcode 3 and then switched to xcode 4. What fixed it for me was changing the compiler in the project settings.
The default compiler up to xcode 3 was gcc, while the default compiler on xcode 4 is LLVM gcc.
Now, I don't know exactly what's the issue that gdb could have with LLVM gcc, but switching the compiler back to gcc in my project settings and doing a clean build fixed my debugging issues.
Might be worth a try.
Have you checked which debugger is being used GDB or LLDB? Select Edit Scheme from the Product menu, and see what the Debugger setting is under the Debug scheme. You could try switching between GDB, LLDB, and None and running in between.

Xcode Debugger Console doesn't display anything

I've been developing iPhone applications for a while with Xcode. But since this morning, my debugger console doesn't display anything anymore. I've reinstalled Xcode, but it doesn't help.
Has someone had a similar problem? What can I do to repair it?
Thanks for your help.
If the console doesn't even display the welcome message maybe see (in Xcode preferences) if the font you are using somehow became corrupted. Also see what foreground color you have assigned for the font and that it isn't a white color. If you click in the console window is there text that is not visible but that you can select?
If so, try Cmd+C and paste it in TextEdit maybe. Also try switching the debug prompts to another font. You will find the settings for switchings those prompts under Xcode prefs > Debugging in Xcode 3 and under Fonts & Colors, I believe for Xcode 4. Even though you did re-install I can't remember if the preferences plist will get deleted in the re-install. The Xcode preferences plist should be under ~/Library/Preferences/com.apple.Xcode.plist. Try renaming that file temporarily before starting up Xcode.
If the console does display the welcome message but you get no output from your program see if you are using an NSTask and setting stderr to be used for your own output. I had this happen once but I was also using SenTestingKit at the time to do my unit tests and somehow it ended up to where noone was able to print to the console - not my cli program and not the testing kit.
As a last resort, Xcode 3.2.4 is out since a few days.
I had the same problem, after I created a new scheme for testing target according to Apple Unit Test Tutorials. I was seeing only (lldb) message at the top left corner and nothing else. I deleted this scheme and it started working normally. I think, I made something wrong, when followed instructions.
So, try to delete schemas, except the main one.
To anyone wondering why console output isn't shown in tests, ensure the following is selected in Xcode prefs:

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...
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/
Make sure to start debugging by pressing "Cmd-Y"... and not "Cmd-R" :-)
You may try last trick in case nothing can help.
If your application launched successful on your device from XCode but did not stop at breakpoints - try press "pause" button after start in debug mode. If you will see application paused properly (do not react to user's action) add new breakpoint then press "run" to continue application execution. In some cases it may helps to stop at new breakpoint.
Yes, just set your project to build for the Device.
If you need to setup debugging for jailbroken iPhone (up to 2.2.1) (not pay 99 to Apple yet) follow next steps:
Install MobileInstallationPatch for your iPhone via Cydia (use Search Tab)
Switch off PROVISIONING_PROFILE at XCode: Go to /Developer/Platforms/iPhoneOS.platform/Info.plist, add next keys:
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>NO</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>NO</string>
You may also add these keys to any
project particularly at XCode, Project
Build Settings, User-Defined
variables.
Add key to your project Info.plist at XCode
SignerIdentity = Apple iPhone OS Application Signing
Don't forget to install and add to your project settings self-signing certificate from Apple
http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW2
"Build and Go", you can connect iPhone and start debugging.
Important! You may need to install and launch at least one legal app (any free one) from App Store first (before "Build and Go" step). Otherwise your application will be successfully installed by XCode to your device but may not be launched. Try this troubleshoot first in case of problem with app launching.
Yes. Debugger and performance tools work fine on the device. That's where I do most of my debugging.
Xcode>preferences>debugging uncheck load symbols lazily
fixed the breakpoints not holding in device problem for me.