Why does my iPhone app crash when not launched by xcode - iphone

The iPhone app I am developing has a strange quirk where it runs ok when xcode has launched it, but not when launched directly on the device.
I've checked the crash logs and the exception seems to be occurring in libxml2.2 in xmlParseCharData. It's quite a big xml document that is being parsed so I think that might be the problem.
I tried with a smaller xml document and this was fine. So either it is the size of the document or something in the document that is causing it but the same large document is parsed ok when launched via xcode.
Any ideas why this would be happening or how I might start trying to debug it?

I found the problem. The app was taking too long to start. I eventually noticed in the console log in organizer that this was the problem. I changed the app so it has a proper landing screen and it works fine now.

I found a Apple Technical Q&A about this issue.
http://developer.apple.com/iphone/library/qa/qa2009/qa1592.html

Related

Unable to run app in Simulator Xcode 6

Yesterday i was testing my app in the iOS simulator and everything was working fine. I then decided to run the app on my iPhone and i got the error unable to install application, Unknown error occurred this has happened before so I cleaned my build folder (as this has fixed this issue before) however, the same error occurred. I then ran the app in the iOS simulator again and now i get the error Unable to run app in Simulator, An error was encountered while running (Domain = LaunchServicesError, Code = 0). I find this very weird as i didn't change anything besides trying to run the app on my iPhone. I have tried every solution given on this post and still no luck.
I'm sorry if my question doesn't contain much detail but as I said I didn't change anything and it was building and running fine a minute before plugging in my iPhone and trying to run it on there.
Any help would be much appreciated.
edit
I tried running other projects (with and without extensions) and they are working on both simulator and iPhone, therefore the problem must be within my project. (my project does have a today extension)
In that kind of cases I usually :
Product > Clean
Close xCode
Delete the Derived Data (in ~/Library/Developer/Xcode/DerivedData subfolders)
Delete the app on the iPhone
Reboot the iPhone
Restart and rebuild
I had this problem. In my case, it was caused by the Build value being blank. After putting a value there, and resetting the simulator once more, the issue went away.
I had the same problem and checking the system log carefully helped me to identify a coliding library that was causing this error. You can also check this answer if you are using extensions.
Generally it means there is a problem with the build, it may be due to old cache (solved by a clean build) or a project definition error (missing library, bad definition in info.plist, etc).
In my case it happened only on iOS 8, turns out that my widget had the wrong bundle ID.

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:-)

SIGABRT on iPhone but not simulator

My IPhone app is suddenly giving a SIGABRT error message when I attempt to run it on my iPhone, before even the first line of the application delegate is reached. It runs fine in the simulator, and even restoring previously working snapshots give the same error when I attempt to load the application on the device.
I fiddled with the Product Name build setting and the data model prior to the problem occurring, but as mentioned, old snapshots that ran fine now won't load, suggesting that the problem isn't in the code.
I have tried restarting xCode, the computer, the iPhone and deleting the app but the problem is still occurring.
I am sure that the problem lies with the device
Any ideas what the problem might be or how I can fix it?
Taking on Till's suggestions I reinstalled iOS (well, actually I updated it to 5.1) and everything is working again. Thanks for the advice. I've no idea what went wrong, but at least its working again now!

When debugging with XCode, app works fine, when running it on device or simulator, app crashes

My application crashes when freely running it on a real device or in the simulator. When I'm running it with XCode attached, the app works fine.
The app doesn't give me any errors and since I'm not running it with XCode attached, there is no message sent to the logger.
Any idea of what could be wrong or how I could find out what causes this crash?
Thanks!
You can read about CFRelease in detail in the following thread
Cheers
If you just want to test in a device why don't you try through iTunes. Find the Target of your project in the Finder, then drag it to iTunes. You can then sync the applications. This is not a solution but an alternative to run the app on your device.
Thanks Aditya,
The crash logs in the Organizer are actually very well detailed and they even include the line of code in the implementation file where the app crashed. When going to that line of code it seemed that I was CFRelease -ing a ABRecordRef, which is an integer of some kind...therefore I shouldn't release it
The weird thing is that it didn't crash or complain while debugging, but when running it on the device it did.

Why is XCode Organizer console sometimes empty when I connect my 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.