Test Significant Location Change – iOS Simulator

significant location change

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.

 

 

 

  1. Run your app normally in the simulator. slc - edit scheme
  2. Simulate a changing location via the iOS Simulator menu Debug>Location>Freeway Drive.
  3. Terminate your app with by double-tapping the home button (or ⌘⇧HH) and swiping up. This should engage monitoring for SLC.
  4. Set whatever break points you want (e.g., application:didFinishLaunchingWithOptions: )
  5. 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).
  6. Run your app again (⌘R) and it will show status “Waiting for <appname> to Launch” in Xcode.
  7. 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.