2

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?

Marc
  • 3,386
  • 8
  • 44
  • 68
  • I had been using iSimulate for the same purposes. Eventually it stopped working because it hasn't been updated to support the new Core Motion framework. Just in case you're using Core Motion acceleration that's something you might want to check. Otherwise just switch to iSimulate, it's so much easier to use and requires no code changes (just add the lib). – CodeSmile Jan 22 '13 at 01:37
  • Thanks, you just saved me a ton of time. I never got Accelerometer Simulator to work for some reason, despite hours of effort. I took your advice and got iSimulate and it works fine. The only downside is that I needed the pro version at $15.99 to use the accelerometer, but at least it worked. Thanks. – Marc Jan 22 '13 at 04:34

1 Answers1

1

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.

System123
  • 523
  • 5
  • 14