简体   繁体   中英

Using Accelerometer Simulator in XCode

Has anyone out there successfully used Accelerometer Simulator in their iPhone app? I am trying to use it in a COCOS2D app and cannot get it to work.

The app and code and their usage are discussed here: http://code.google.com/p/accelerometer-simulator/wiki/Home . The system consists of the AccSim app that can be downloaded from the App Store, and some code that you must compile into your XCode project.

I am of course trying to use the accelerometer readings of my iPhone to control something inside my app in the IOS simulator. My iPhone has WIFI turned on, and is on the same local network as my MAC where the simulator is running. Yes I checked to make sure that both my iPhone and my MAC are on the same WIFI network. The AccSim app on my iPhone is broadcasting accelermoter information on the default UDP port 10552. Both devices are inside my home network and my modem is a 2WIRE modem providing internet service from ATTUverse.

Inside AccSim I switched the Network switch to On. It is in Broadcast mode, to Address 255.255.255.255 and port 10552 (the default). I also tried Unicast to the IP address of my MAC inside the network but that didn't work either.

It seems that no matter what I do, my app in XCode never sees any accelerometer input - it never sees any UDP packets as near as I can tell.

Is there something I'm missing?

BTW I also verified that it is indeed the AccelerometerSimulation class that is being sed. In COCOS2D, I had to add these files to COCOS2D itself and import AccelerometerSimulation.h into CCLayer.

Any ideas anyone?

I have recently rewritten that simulator plugin to support the new of doing things, as well as Gyro and magnetometer data. I used an app called SensorMonitor (it's free) to record a bund of measurements from the phone then used matlab to play this info back over UDP to the simulator. You can find my CMMotionManagerSim class at iOS Simulator Sensors

The class isn't complete yet, I am adding to it as I require for my project but hope it helps. So far on Accelerometer works but others will be working soon.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM