Swift App crash on device work fine on simulator - ios

I have an app that works fine on simulator but when I run it on Ipad it crashes randomly. I am really in big trouble I have to submit the app tomorrow.
I cant understand the crash report, and the app is big I have 40 files, and many segues and http requests. its impossible tocheck on each file!
where to look?
does this hint on anything:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010014c164
Triggered by Thread: 0
Please guys any help will be great, am in big trouble!
Update:
the application has many api calls, after doing like 4 - 5 calls the app exit and stay in the background.
I can't know if its the actual issue, but I am guessing here because staying on the same page, the app won't crash.
what should I do guys?

It is a little hard to give you concrete help with this information.
I would suggest you add a crash report tool to your app (like Crashlytics).
That way you will get a readable report when an actual device crash and a will be more reasonable to fix.
It is a good practice to have a crash report tool in any production app.

Related

What's the life cycle of iOS app on an app crash?

I'm trying to log a time before the app gets terminated and it seems to behave differently on an app crash so the time never gets logged. NSSetUncaughtExceptionHandler is a potential solution but I'm finding that it's not recommended if we're already using other 3rd party frameworks like crashlytics / fabric. Can anyone suggest the proper approach to solving this problem?

How to debug a crash that occurs randomly in an iOS application?

Currently, I am using Crittercism for crash reporting and making sure that I add dSYMs to get symbolicated crash reports.
But it is not helping with some of my crashes which are segmentation faults (SIGSEGV and SIGBUS). They occur randomly and I haven't been able to reproduce them on device and on simulator. I have tried to find a pattern by trying my app on different ios devices with different network connections (3G, Wifi, Edge) but with no success.
What can be my next step?
Not much to go on, but here are a few places to look:
If you have multiple threads, check to make sure they are behaving properly. Make sure you synchronize properly if multiple threads could be accessing the same objects.
Check your NSNotifications - could one be posted when you are not expecting it?
I have found that the hardest bugs to find are those that are caused by asynchronous events - either in other threads or due to external events that you might be monitoring.
Not being able to reproduce the bug in your development environment will make it very hard to find.

Capturing native exceptions in Cordova/PhoneGap

I've got a Cordova/PhoneGap + JQueryMobile application running on iOS and a few customers are reporting that the app is just "vanishing" on them during certain interaction points.
Unfortunately I'm not able to reproduce it, so I'm kind of stuck. I'm wagering that the app is running out of memory or maybe hitting some other kind of iOS level exception.
What I'm wondering is this - does anyone have any suggestions on a good way to capture native exceptions in PhoneGap and either log them or trigger a crash report that the user can email to us? Until we can see what the crash is being triggered by, there is no hope of fixing it.

iOS Crash Follower

Is that possible to complete a function(iOS Crash Follower) in the code for finding crash address or grasping the last called function in the callstack when app crashed?
With this function,we can easily to find out where the app crashed and then show crash information on the console, or maybe it can collect crash information before it feedback to us when mobile-net works.
Is anybody knows?
And give BugHD a try, iOS OSX & Android all supports, with very detail crash report.

IPad - Crashing with no apparent reason

I know it's a bit weird but I have no code at all to put here, unless I copy all of it.
My project is crashing with no apparent reason. I've read this solution: iPhone application is crashing and not leaving behind a .crash log file
and I'm using Instrument for searching for leaks and other possibilities for those crashes.
Another strange thing is: even when I run my app with debug on XCode, it just stop to work on my IPad but it looks it is still running.
And the last and more strange thing: there's no crash log at all on my device. Before somebody ask, it is enable to record crash logs.
Does anybody have any idea for helping me?
Regards
I've had this happen to me before on various platforms. If its crashing on you, whether its an iPhone app, openGL / DirectX program, try these steps:
Have you tried to undo your last change and get to the point where it last worked?
Have you tried placing a print outputs to the terminal to see how far your program is executing? Start at the beginning and work your way into your program. This is especially useful when there is no crash log.
Also in particular to iPhone apps: Have you checked your xib's? Did you recently re-factor and change the name of a class maybe? You might need to re-link your nib to your classes. This on more than one occasion has caused apps of mine to crash with no error. Hope this helps.
I doubt you are still wondering about this, but my answer is that you were experiencing your app getting killed by the OS due to using too much memory. This will silently fail in the log in my experience when running on the device.
You will have to go into the Organizer to the device console and crash reports that get stored on the device to see the clues.
The reason your crash stopped when you got an iPad 2 is because the iPad 2 has twice the memory of the iPad 1 (which is dramatically under-stocked with RAM)

Resources