I wonder if I could test Significant-Change location service (startMonitoringSignificantLocationChanges method ) in Xcode Simulator or it just only works in actual device. Notice, I already tried it in Simulator and it didn't work, but I'm not sure if this only because it don't work on simulator or because I did something wrong.
Thanks
The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators.
Viewing & Testing. When you're in the simulator, click open Safari, click on the URL bar, and you can paste the testing URL using ^⌘V (Edit > Paste Text), then hit enter.
Click view-->show toolbar if you don't see it. Click on IOS Device and you should get a drop down menu of devices. The simulator should be in that list. Save this answer.
See XCode / iOS simulator: Trigger significant location change manually. You CAN simulate significant location changes but it can takes about 5 minutes before you get an update if you're using the simulator's "freeway drive" location debug mode.
I've answered this question before on SO, and using the simulator is not an accurate way to test for -startMonitoringSignificantLocationChanges.
This method relies primarily on cell-tower triangulation and hand offs. You can occasionally get an initial fix from the simulator, but that is it. It won't update any other location after that. You will have to test on device to see if your program is responding properly to this method.
One alternative is to test any logic you may want to perform inside your callbacks for -didUpdateToLocation and use -startUpdatingLocation instead. While this is a big drawback for battery life, it will allow you to get accurate location updates for testing. When you have all your kinks worked out in the simulator, transfer everything over to the significant location change methods and test on-device.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With