I'm using Xcode 5.1.1 making a game app in iOS 6+. I am currently not a member of apple development, at least not until i finish the game completely. Sometimes right after i quit the simulator i get a "Terminating in response to SpringBoard's termination" message appear. I know it's a memory management issue but with ARC i don't deal with memory. Also does this have something to do with the size of my app? But i don't know it's size. One minute Xcode shows 40mb and the next it'll show 12mb or 20 mb and other mb's in between so i don't know. Lets say i publish the app in app store and don't fix this rare termination issue, how would that affect the user when using my app? How would i fix this termination message issue?
If you're quitting the simulator via command-Q, then a "Terminating in response to SpringBoard's termination" message is actually proper (the simulating app is terminating before the simulator -- that app known internally to Apple engineers as SpringBoard -- terminates).
As for your memory worries, once you get the hang of Xcode, you should try running your app under Xcode Instruments and with the Activity Monitor template and/or the Allocations template.
Related
Starting from iOS 12 the CLLocationManager doesn't run endless anymore in the background. The app get's terminated without a crashlog at random times. This was working fine before iOS 12.
To demonstrate this problem I've created an sample app here
The demo app just launches an CLLocationManager and keep this running in the background. While running on the background we keep track of it by logging it. The problem is that the app get terminated by iOS. The demo app is created to demonstrate this problem.
Steps to reproduce
Run the app on the device
Grand access to locationmanager
Put the app to the background
Wait for 1-48hours
Result:
The app is terminated
App is terminated without any reason after random time.
Expected result:
The app is still running.
How it should work
This is confirmed by an Apple engineer:
Once the CLLocationManager updates are started in the foreground and you did all the work to have it running in the background, the location updates should run endless in the background until:
app is force quit
device is rebooted
app stops location updates
app releases the CLLocationManager object
app crashes
iOS terminates the app due to memory shortage,
the locationManager object is released, overreleased, or overwritten. You should make sure that your view controller is not being instantiated, which then resets the locationController class. If that happens when the app is in the background, you will restart updates, which will cause the app to be eventually suspended. You should make sure the locationController is a singleton.
app is crashing. Check to see if there are crash logs on the device you are testing
iOS is terminating the app due to memory shortage. In this case, you will find JetsamEvent logs on the device that shows your app being terminated. You can check the timestamps and locate the one that is around the time your app stopped working.
Updated answer:
Apple fixed this bug in iOS 12.2 beta 2 (16E5191d)
Original analyse and bug detection:
Together with Apple Developer Technical Support we have analyzed this issue with Sysdiagnose files. Following these guidelines you can install profiles to have more logging on your device. I don't know exactly how these logs work and where to find this issue, but Apple did this for me and came with this first analyse:
On the suspension event you observed on 2018/10/22 01:01:12:587, this
is what I see (about a minute after your last activity logging)
[CllocationManag:2725] Terminating with description:
{
owner = ;
target = rw.sp.flitsmeister.frameworks.CllocationManagerBackgroundTest; }
This is basically saing that your app was terminated, because the
system needed drive space, and killed a bunch of apps so it can delete
their /tmp and /Library/Caches directories. I have seen this process
to be a little more aggressive in iOS 12, but seeing you are on a
256GB device, and have ~179 GB free after the cleanup, I am finding it
hard to believe this was justified.
After sending some more sysdiagnose and reproduction cases Apple did his best to analyse and ended with the following conclusion:
Unfortunately I don’t bring good news.
It turned out that, currently in iOS 12 there is a new mechanism that
will terminate long running background apps periodically as the system
needs to free resources. At this time, this process is a bit too
aggressive, and I am working with the relevant teams to get this to
behave better.
So, at this point, I would like you to file a bug report. Explain the
symptoms. And make sure you upload the sysdiagnose files along with
the bug report. (I already sent yours in, but it doesn’t hurt to have
the new ones as well). And let me know the bug number please.
So this means that currently in iOS 12 you app won't run endless on the background. I've filled in a bug report, the number is 45581276 and will try to keep this thread updated.
I tried clearing out the /tmp and /Library/Caches directories when the app goes in the background without any change in behavior. I also tried the same periodically when the app processing background locations without any change as well.
I am having an issue where when I swipe up on my app to close in the simulator, the app will not open again unless re-run. I am getting an error Message from debugger: Terminated due to signal 9. I looked this up and read the issue may be related to CPU usage on the device but mine is very low. I am not even sure how to begin debugging as it is not clear where the issue is coming from. I am getting the user's location but I am doubtful that is causing the issue. I've also read a bit about background tasks causing this but am not confident this is my issue. I know this is a vague issue and I am happy to post code snippets once I can narrow down where the problem may lie. Does anyone know where I can begin debugging?
There's nothing to debug here. What you're describing is the expected behaviour of the task manager: swiping up kills a running app, in a way that cannot be intercepted or denied, using signal 9, SIGKILL.
You get the "Terminated due to signal 9" message, when your app gets killed. It might occcur when you swipe up and kill your app when it is running or else if you go to settings and change privacy settings for your app like changing location services or camera permissions for the app. It might also happen when you are debugging in your iphone device and the lightning cable is faulty, it will disconnect and the terminated signal will be thrown in the debugger.
I submitted my app to iOS the other day and unfortunately it got rejected. Apparently it crashed on launch. The game runs perfectly on Android, and I cannot re-create this "crash on launch" on iOS. For me it just works. But my test-environment is limited to an iphone 5 and emulators.
Could someone please take a look at these error logs and see if they can find something?
Error log: Here
If you know why, or have any ideas/suggestion, please let me know.
According to log your exception code 0x8badf00d . This code indicates that an application was terminated by iOS because a watchdog timeout occurred. Basically, the application took too long to launch, terminate, or respond to system events.
I have an application written in Swift 2.1, under XCode 7.3. The steps to reproduce the issue are as follows:
Run application and then move it to background (etc. open another app etc.).
Play with other apps until our app gets "Terminated due to memory issue".
Try relaunching application through recently used apps menu (the one that shows after double clicking the Home button).
And now weird things happen. If the application is connected to XCode, the restart is flawless: app gets cold start and is running fine. However, when it is running standalone it crashes after few seconds of displaying last frozen screen. I am totally stuck: there is neither any sign of this crash in device logs, nor Crashlytics which we use to report crashes sends anything. There is also no problem with optimization, as some folks have suggested in other similar situations, since it happens on the same exact debug build. What is more surprising, the app launched from spring board starts normally. I would be grateful even for hints how to tackle this situation.
EDIT:
I forgot to mention that this behaviour is 100% reproducible on iOS 9.3 and 9.3.1. I have encoutered it on iPhone 4S and 6S Plus.
I am currently importing all the facebook birthdays and inserting them in core data,then i sort them according to the latest bday's(fetching and sorting).
When i use facebook to sync and get all the contacts,my app retrieves all the contacts perfectly,but after it receives the contacts it soon crashes..
i tried using zombie objects.
i tried leaks.
i tried adding an exception in exception navigator.
i synced my ipod with itunes went to library and device logs but couldnt find any file which says low memory issue or something that sorta.
i am confused because the reason for the crash doesnt show up,it simply crashes and when i open my app again i can see all the contacts imported from facebook
there is no lldb in the debugger window,when i change it to gdb,i can see gdb but when i use backtrace(bt) it say "No Stack"
i also noticed there is one thing i.e if there are too many contacts my app crashes and if there are less contacts it works normally.
what can be the problem? does it crash because of a memory issue?
how am i supposed to know what is causing the crash?
thanks
Your app is most likely being terminated due to low memory.
The best thing is to look at the device console using Xcode's Organizer:
If iOS is running out of memory and killing your app, you should see something like this:
<Notice>: jetsam: kernel termination snapshot being created
<Warning>: Application 'UIKitApplication:com.yourapp[0x6337]' exited abnormally with signal 9: Killed: 9
You should use the Activity Monitor in Instruments to see how much memory your application is using.
You can also use the Memory Monitor instrument and enable graphing of "Physical Memory Free". If you see the graph approaching 0 before your crash you can be pretty sure it's a memory issue.
Try to put some code for memory releasing into viewDidUnload. For example, if you create a link between code and xib using mouse then xcode generates code for current element automatically.