Giter VIP home page Giter VIP logo

iphone-geospoof's Introduction

#iPhone GeoSpoof ##What this is 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.

##How to use it There are two very simple approaches you can take. One is easier upfront, and one is better in the long run.

Quick & Dirty way

  1. Import the the .h and .m files into your project.
  2. Comment the #ifdef SPOOF and #endif directives when you want to spoof

Better

  1. Import the .h and .m files into your project.
  2. Duplicate one of your testing build configurations
  3. Define SPOOF 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 #ifdefs in a production app would you?

##How it works 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.

##Credits I got this idea from this post on StackOverflow: http://stackoverflow.com/questions/802156/testing-corelocation-on-iphone-simulator/2060315#2060315

iphone-geospoof's People

Contributors

derrickj avatar

Stargazers

Tom Sundstrom avatar Will Jardine avatar  avatar Leonardo Wong avatar Andrew McElroy avatar DominixZ avatar Willi Wu avatar Marc Boquet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.