Giter VIP home page Giter VIP logo

phoney's Introduction

Phoney

Phoney is a sensor simulator library for iOS. It simulates the rotation data provided by CMMotionManager. It can be if you are running a simulator and need to simulate rotation of the device, or if you need to precise rotation test cases that can be persisted.

Installation

  1. Clone the repository somewhere on your hard drive
  2. Open your project in XCode
  3. Drag and drop Phoney folder into your project
  4. Build it as a static library

Usage

If there deviceMotion isn't available on the device, you simply instantiate the DummyMotionManager instead.

self.motionManager= [[CMMotionManager alloc] init];
BOOL deviceMotionAvailable= [self.motionManager isDeviceMotionAvailable];

if(!deviceMotionAvailable){
    self.motionManager= [[DummyMotionManager alloc] init];
}

self.motionManager.deviceMotionUpdateInterval= myUpdateInterval;
[self.motionManager startDeviceMotionUpdates];

From there, you can read the rotation data.

CMRotationMatrix rotationMatrix= self.motionManager.deviceMotion.attitude.rotationMatrix;
CMQuaternion quaternion= self.motionManager.deviceMotion.attitude.quaternion;

Simulating rotation

But how do you actually simulate the rotation? PhoneyUI. It will simulate rotation and send the data to localhost using UDP on a configured port. Make sure that port in your .plist file matches the port in the PhoneyUI. You can configure the port by adding a value for "PhoneyPort" key inside your .plist file. The default port is 28000.

phoney's People

Contributors

nmarkovic04 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xyzr0482

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.