Git Product home page Git Product logo

geofake's Introduction

GeoFake.framework

Simulate Location and Motion information for Debugging iOS apps. GeoFake framework works with GeoPlayer.

debug_desk

If you ever build your iOS app using GPS, you probably experienced the difficulty of debugging it on the desk.

Unless testing your app in outdoor field, you can not realize unstable behavior of GPS, Cell-tower and WiFi.

Your fitness app draw your running route on the map exactly ?
Your travel app get correct information while you are walking around ?
These apps need moving-around-test in outdoor many times.

For such case, iOS simulator has location-simulation debug feature. But that simulation is not good enouth, because it is NOT using real information.

DiamondheadRun

Playback real GPS movement

GPS signal jumps from entrance to exit of tunnel, for example. GeoPlayer can record such unusual behaviors and can playback them. These recording data will be very important debug resource for your job on the desk.

connect_iphones

Playback GPX data

GeoPlayer playbacks GPX data and playback speed is same as recording speed. If you have marathon data of three-hour-finisher in iPhone(A), you can playback it in three hours and send location information of each second to iPhone(B) via Bluetooth.

iPhone(B) receives that location information and act as if running that marathon right now. You can debug your GPS app in iPhone(B) using information from iPhone(A) like this.

Playback motion data

Also GeoPlayer can send motion information to iPhone(B). When using iPhone with M7 processor, GeoPlayer can record location and motion data at the same time. Motion data are activities like walking, running or stopping.

debug_code

Geo fence debugging

Using GeoPlayer and GeoFake framework, you can test your GeoFence app on the desk.

Precise simulation in manual mode

GeoPlayer has manual operation mode. When you move GeoPlayer's map with your finger, the map of iPhone(B) will follow your finger movement. So, you can simulate location precisely while debugging.


How to debug your GPS/Motion app with GeoFake.framework

Video tutorial available here.

  1. add Framework

    GeoFake.framework

  2. import header file

    #import <GeoFake/GeoFake.h>

  3. initialize location update

    #ifdef GEO_FAKE [[GeoFake sharedFake] setLocationManager:_locationManager mapView:_mapView]; [[GeoFake sharedFake] startUpdatingLocation]; [[GeoFake sharedFake] startUpdatingHeading]; #else [_locationManager startUpdatingLocation]; [_locationManager startUpdatingHeading]; #endif

  4. initialize motion update (if needed)

    void (^motionHandler)(CMMotionActivity *activity) = ^void(CMMotionActivity *activity){ _motionActivity = activity; // whatever you need to do };

       if([CMMotionActivityManager isActivityAvailable]) {
    

    #ifdef GEO_FAKE [[GeoFake sharedFake] startActivityUpdatesWithHandler:motionHandler]; #else _activityManager = [[CMMotionActivityManager alloc]init]; [_activityManager startActivityUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:motionHandler]; #endif }

  5. set link flag at "Build Settings"

    Linking Other Linker Flags "-ObjC -all_load"

  6. build and run !


How to connect with GeoPlayer

Please visit this website.


GeoFake Class Interface

@interface GeoFake : NSObject
// Shared instance + (GeoFake *)sharedFake; // Fake CoreLocation (Location update) - (void)setLocationManager:(CLLocationManager*)locMan mapView:(MKMapView*)mapView; - (void)startUpdatingLocation; - (void)stopUpdatingLocation; - (void)startUpdatingHeading; - (void)stopUpdatingHeading; // Fake CoreLocation (Region monitoring) - (void)startMonitoringForRegion:(CLRegion *)region; - (void)stopMonitoringForRegion:(CLRegion *)region; - (NSSet*)monitoredRegions; - (void)requestStateForRegion:(CLRegion *)region; // Fake CoreMotion (Motion activity) - (void)startActivityUpdatesWithHandler:(CMMotionActivityHandler)handler; - (void)stopActivityUpdates; @end

geofake's People

Contributors

alohayos avatar

Watchers

 avatar  avatar  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.