Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I test Significant-Change with Xcode simulator?

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

like image 264
user836026 Avatar asked Dec 30 '11 18:12

user836026


People also ask

Does Xcode have a simulator?

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.

How do I test my website in Xcode iPhone simulator?

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.

How do I select simulated device as destination in Xcode?

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.


2 Answers

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.

like image 96
Ryan H. Avatar answered Oct 06 '22 01:10

Ryan H.


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.

like image 30
Bill Burgess Avatar answered Oct 05 '22 23:10

Bill Burgess