Alex Rivera | Logout

Simulating location changes for `startMonitoringSignificantLocationChanges`

Asked 2011-12-17T01:39:42.547
27

I am writing an iPhone app and using Location Services. I am using the startMonitoringSignificantLocationChanges method on CLLocationManager. (As I understand, this is for low power, low accuracy location services.) When I build and launch my app in iOS Simulator, it gets my location fine. However, I want to simulate updates to the location beyond the initial fix.

I did notice these two options:

  • iOS Simulator : Debug > Location menu
  • Xcode 4: Product > Debug > Simulate Location menu

Both of these work acceptably for simulating an initial fix. (For example, choose 'Apple' from the former, or 'Moscow' from the latter.) However, subsequent changes to either of these will NOT trigger another location update in the simulated app.

What I desire is to be notified when the simulated location changes when using startMonitoringSignificantLocationChanges. (iOS Simulator does generate a series of updates when I use startUpdatingLocation instead.) This makes it way easier to test location-enabled applications without taking the device out into the field.

Two questions:

  • What is the difference between these two?
  • How do I use iOS Simulator and/or Xcode 4 to simulate a series of location changes?

Cheers.

Edit
Report

1 Answer

9

FWIW, the monitoring of significant location changes is tied almost exclusively to cell tower triangulation and handoffs. The way this is handled in the simulator is probably much different than it would be on-device. Even region monitoring get the added bonus of Wifi and other apps using location to get more frequent updates.

I'm guessing this is just how the simulator works, even by passing in locations that are wildly far apart and should logically trigger, that just isn't how the updates are handled. There are no cell tower handoffs in the simulator, therefore no way to really test out the significant changes.

answered 2011-12-23T17:35:42.947

Your Answer