Debugging Location-Based Apps With Ease: FakeGPSUtility
Azoft Blog Debugging Location-Based Apps With Ease: FakeGPSUtility

Debugging Location-Based Apps With Ease: FakeGPSUtility

By Andrei Dirsha on September 18, 2014

debugging location based apps with fakegpsutility

From sports to city guides – many apps now deal with location and heading-related events. Testing those apps is quite a tricky process, as it doesn't matter how well you test it at your current location, if you are going to offer it to users worldwide. Don't panic, there's a better way to fix a naughty bug appearing, for example, only in Honolulu than relying on vague bug reports from Hawaiian users. To lessen this burden, we’ve made FakeGPSUtility, an instrument that allows you to replace data for the CLLocationManager with custom parameters.

How to Install

There are two ways to install FakeGPSUtility from GitHub: either manually or from CocoaPods.

Manual

  1. Drag the FakeGPSUtility folder into your Xcode project.
  2. Define 'DEBUG' in target build configuration.
  3. Add MapKit and CoreLocation frameworks into your target.


From CocoaPods

  1. Enter in your *.pod file: pod 'FakeGPSUtility', :git =>
    'https://github.com/Azoft/FakeGPSUtility.git'"
  2. Define 'DEBUG' in the target build configuration.


Start Testing

That’s all there is to it. Now you’re ready to test various user locations in your app.

To run this utility on an Apple device, complete the handshake, then press the “Simulate Location” button. On the next screen, you will see a map and can configure the tool and stop/pause/resume simulation for custom locations.

The utility settings offer three modes (starting with iOS 7.0 there are four modes) of simulation:

  • Single – allows choosing one point on the map whose location the tool will simulate;
  • Multiple – offers choosing several points on the map for simulating location;
  • File – uses points from a *.plist file, so there is no need to set them manually. To use this mode, add a Ponits.plist file to the app sources;
  • Route – allows choosing two points with a long-press gesture and creates a route between them. Simulation of coordinate changes will be made along this new route. Besides, you can define the value for updates of route coordinates per second and loop a route. This mode is available for only iOS 7.

After you have configured this tool, close the menu and continue debugging your application.

I hope I have convinced you that setting a custom current location does not have to be a chore. With the right tool, it can be relatively easy.

VN:F [1.9.22_1171]
Rating: 5.0/5 (5 votes cast)
VN:F [1.9.22_1171]
Rating: +8 (from 8 votes)
Debugging Location-Based Apps With Ease: FakeGPSUtility, 5.0 out of 5 based on 5 ratings

Content created by Andrei Dirsha