My app sometimes crash if it has been in the background for a while and I bring it back into the foreground. How can I debug this? Can I pull out the "console log" from the app even though it is not connected and running via Xcode?
Related
My notifications is crashing the IOS App when the user clicks the notification after the app was killed and removed from the background/foreground. I don't know how to get debugging information if the app isnt being ran.
You need to edit your scheme, choose Run on the left bar. and Info on the top tab bar.
Change Launch to wait for executable to be launched.
Now, you can run the app. the app will not launch and therefore, will not crash.
get the notification, open it, and debug the crash.
I have an issue on my iOS app that occurs every time I restart my iOS device (i.e. after turning it off and on again). I turn off the device with the app in foreground, restart it and then relaunch the app from the background.
Obviously, the Xcode console doesn't show debug message when the device is turned off and I don't manage to know what happens to the app when the device is restarted. If I restart the app from Xcode, the issue disappears and everything works flawlessly again.
Also, it seems that the app is relaunching itself from the background when the device restarts. Is it possible to prevent this behaviour and force the app to restart from scratch when I tap on the app icon or on its screen from the multitasking?
Thanks.
If you want to force close apps, double tap the home button and then you can swipe away the background process.
To debug the process after restarting the device and opening the app again, you should be able to attach the Xcode debug console to the running process. In Xcode do:
Debug > Attach to process > [select your process]
We are working with a developer that is having a hard time debugging an issue so I thought I would post here.
When we receive the build and install the app it will work fine, but after the app being in the background for a few days when we tap on the icon it will show the loading screen and then crash.
When tapping the button twice we will see the app in the background and when we bring it to the foreground it is frozen.
The same similar issue happens if we install over a previous build it crashes upon initial launch.
One of my developer friends said it might have to do with the auto login. We have Crashlytics setup but it's not catching these crashes. Does anyone have any ideas of what this could be?
I have a problem with my app: if i launch it with Xcode all goes well. If i manually terminate The app and then i try to open it again(not running it with Xcode, but simply tapping the icon button) instead of reopening from the start, The app shows me the last screen i opened before terminating it and remain stuck, totally blocked. In that moment, i'm not under control of Xcode console: how can i visualize an error eventually occurred?
When you run your app from Xcode, it attaches a debugger to your app. This prevents the app from closing normally. You'll need to press the stop button in Xcode to detach the debugger and let the app quit so you can launch it from the iPad normally.
I have an app that has the UIApplicationExitsOnSuspend info list property set to TRUE.
And now I am noticing a curious issue.
I start up the app and let it run on my phone and do not touch my phone. Eventually the phone screen goes dark and the phone goes into standby mode. When I wake the phone up, what I see is a screenshot of the last screen displayed on the app. (This seems according to spec, since the Apple documentation says that in the process of moving an app to the background, ios takes a picture of the app and uses that for transitions when the app comes back to life). If I double click on the home button to see running apps, I do not see an instance of the app running. (again, working as intended since UIApplicationExitsOnSuspend is set to true).
My question is, how do I make sure that when the phone wakes up, it comes back to the default home screen and not the picture of the app ? Clearly the app is not running on waking up, so there is nothing I can do from within the app that will refresh the screen. I could try to exit when the app is going to background, but then apple guidelines say, never exit programatically!!.
Any ideas ?
You misunderstand what is happening. If you enable UIApplicationExitsOnSuspend, this means your app will terminate when normally the app would go to the background. If you run your app then let the phone sit idle until the screen goes dark, your app is still in the foreground so it is not terminated. When a device goes into standby mode, the current app is still the current app. When you wake the device, you are not looking at snapshot of your app, you are looking at your running app. Double-tapping the Home button at this point doesn't show your app because your app is the currently running app.
Your app will be terminated if you return to the home screen or switch to another app. But it will not terminate just because the device went into standby mode.
If you want your app to return to its main screen when the device is woken up, then you need to put code in the UIApplicationDelegate applicationDidBecomeActive: method to reset your user interface.