When an app is attached to the Xcode debugger, none of the usual lifecycle methods (applicationWillResignActive:, applicationWillTerminate:, etc.) or notifications (UIApplicationWillTerminateNotification, etc) are triggered.
Is there any way for the app to know it's about to be stopped or re-deployed? Perhaps by trapping a signal?