Testing location functionality can be tough. Significant location change updates especially so.
Here’s how to test SLC in the simulator…
Test Significant Location Change
You may need to reset the simulator (iOS Simulator>Reset Contents and Settings…) to test Significant Location Change.
These steps assume you have setup your app to use the Location Manager to monitor significant location change when your app terminates (applicationWillTerminate: ) by calling startMonitoringSignificantLocationChanges.
- Run your app normally in the simulator.
- Simulate a changing location via the iOS Simulator menu Debug>Location>Freeway Drive.
- Terminate your app with by double-tapping the home button (or ⌘⇧HH) and swiping up. This should engage monitoring for SLC.
- Set whatever break points you want (e.g., application:didFinishLaunchingWithOptions: )
- Edit the app scheme (Product>Scheme>Edit Scheme… or ⌘<) to Launch and “Wait for executable to be launched” – this will engage the debugging but not launch the app unless you click the app icon in the simulator or otherwise launch the app (e,g., significant location change).
- Run your app again (⌘R) and it will show status “Waiting for <appname> to Launch” in Xcode.
- Your app should launch within a few minutes if not right away. You can bring up the Maps app to show that the location is changing.