Iphone-geospoof is a project mainly written in OBJECTIVE-C and C, it's free.
Test Location Based iPhone code
We all know the iPhone simulator is all but useless for testing location based code. To remedy this, I’ve created a simple simple Objective-C category that you can use to simulate location changes. It’s not over engineered. You don’t have to go figure out a weird file format then edit that file to get it to work. Just program your routes.
There are two very simple approaches you can take. One is easier upfront, and one is better in the long run.
#ifdef SPOOF
and #endif
directives when you want to spoofSPOOF
in the Preprocessor Macros section of the build settings of the newly duplicated configuration.This way is better because you set it up once, and don't need to rely on your memory. You wouldn't want to have forgotten to uncomment the #ifdef
s in a production app would you?
It replaces the startUpdatingLocation
and startMonitoringSignificantChanges
methods in the system's CLLocationManager class. The new implementations call locationManager:didUpdateToLocation:fromLocation:
on the location manager's delegate.
I got this idea from this post on StackOverflow: http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator/2060315#2060315