If you start this service and your application is subsequently terminated,the system automatically relaunches the application into the background if a new event arrives. In such a case,the options dictionary passed to the locationManager:didUpdateLocations: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event. Upon relaunch,you must still configure a location manager object and call this method to continue receiving location events. When you restart location services,the current event is delivered to your delegate immediately. In addition,the location property of your location manager object is populated with the most recent location object even before you start location services.
资料来源:Apple Docs
我的问题是,我将如何去调试和/或测试?一旦我终止应用程序,我不知道发生了什么(即调试会话被应用程序杀死).什么时候或者如果iOS在UIApplicationLaunchOptionsLocationKey的launchOption键的后台启动了我的应用程序?更重要的是,我如何知道执行的代码块是否正常运行?如何快速测试这种情况,而不必在终止我的应用程序之后开车,希望我写的神奇的代码工作?任何帮助,非常感谢!