Iphone running out of battery kills app - ios

I'm close to completing my first app and I just discovered a potentially devastating issue. When the battery ran out on my iPhone my app would not open after recharge. Whatever happened, it appears to have been fatal. I was able to recreate the error on another iPhone as well.
Can anyone help me? I have found very little about this on the internet.

I seems to me that you store some data for your app on the device. And this data is in incorrect state after the recharge. Try to figure it out and rewrite data saving code.

Related

Prevent app from being killed in background by iOS Camera app

I have an GPS-Tracking-Fitness-App where the user can track workouts in the background. All of that is working fine. No problem.
But SOME users - not many, but some - have the problem, that opening the camera app on their phones will kill my app.
I can't reproduce it on my phone, but I once had such a phone in handy for debugging, and in the Xcode memory-debugger I could see that opening the camera-app there took about 2-3 GB!!! of ram and my app instantly got a low-memory-warning and was then killed.
I guess my app can't really do something about that?!? It does not use that much RAM itself. So I am wondering if I can somehow prevent that. I guess I did not miss any "background-mode : super-important-to-the-user" or so setting? :)
Or is there a way to at least trigger a Push-Notification in such case? Not sure...
Any help would be greatly appreciated!

iPhone App Close immediately after launching

I have an iPhone app and working fine . But some of(2 or 3) my customers arises a complaint that they are having issue opening the app in the iPhone . They have installed the app and when open the app it just closes out right away. Also tried restarting phone but it still does this.Also tried to delete the app and then reinstall it but this still happens.
Is this any thing i can do in my app to prevent this ? Or how they can solve this problem ?
Is there any more information you could give regarding the nature of the crash? Have you recreated this scenario in Xcode and gotten an error message?
The best I can think to tell you is to look in the app delegate. That is where your app looks first, so there is some kind of uncaught error happening.
Maybe the app is trying to use some piece of data right at launch and it's not there. Maybe you are trying to use something before it is initialized.
Is your app using any 3rd party frameworks right at launch? If so, maybe something changed with the library.
If it is happening on some iPhones and not others, perhaps you are using some framework or function that is not compatible with an older version of iOS.
Perhaps there is something in common among the kind of devices the app crashes on.
Another thought, does your app ask for any permissions? Such as using the user's location. If it does, and there is a spot in your code where you assume you have permission and you don't perhaps that could cause a crash.
Hope this helps.
P.S. just read the comments to your question. They have some good advice. I would try what they are suggesting.

SandboxViolation: WatchOS app crashes when running on device

I have an app for watchOS 3 that works perfectly fine and doesn't really do much. But when I try to launch and debug it on a real device the app crashes and the console logs this:
SandboxViolation: logd(46) deny(1) file-read-data /private/var/containers/Bundle/Application/*Identifier*/*appname*/Frameworks/libswiftos.dylib
I honestly have no clue what is going wrong. I remember it to work before but then on one point it stopped (can't remember changing anything relevant)
Usually this is because you requested for something that requires permission (e.g. Location, Contacts, etc) and didn't provide a permission reason in the Info.plist file.
In my case the solution was that the Watch app took too long to launch. I deleted all upfront initialisation and found out that it was somehow too much (In fact I wasn't doing that much but initialising a picker with images from an extension which took too much time).
After optimising this it worked as expected!

My iOS app every now and then refuses to launch until I reinstall it

I've got an app that uses Core Data that sporadically stops launching so I have to reinstall it using XCode and then it launches again like normal for a while, with all the Core Data information still preserved.
I have seen that an app often stops launching when the target of an app is too low in comparison to the device software version, however this is not so for this app and device (iPhone 6s).
Have you had such an issue before? What do you think could be causing this problem?
There are many, many, many things that could cause an app to fail to launch. You need to narrow things down and collect some data so that you can find out what the problem is and do something about it. Right now you don't even know that it's related to Core Data, you're just guessing.
For a crash on launch, look at the device console and see what messages appear when you try to launch the app and it fails. You can get the device console messages by
Connecting your device to your Mac
Opening Xcode's "Devices" window (cmd-shift-2)
Looking in the bottom half of the window
A better way to watch the console is to use the free iOS Console app.
The problem was that, as mentioned by dan in the comments, the code was being signed for a short period of time (7 days) and so I had to keep re-installing it on the iOS device to keep it working. Thus to keep the app working indefinitely a paid developer account is needed.
Also mentioned in this reddit forum:
https://www.reddit.com/r/jailbreak/comments/4hotx3/news_free_developer_account_installs_reduced_to_7/

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