What’s the biggest annoyance about iPhone programming in the simulator? Well, if you’ve written any programs that use the accelerometer, we’ll just bet that you’ll put “accelerometer doesn’t work in the simulator” right at the top of your list. But ho! Here is how you fix that!
Accelerometer Simulator is an iPhone/iPod Touch application that transfers accelerometer data from the device to your computer using UDP protocol.
The main use case for the application is to allow iPhone application developers to create applications that require accelerometer, without having to do all the debugging on the actual device. By inserting two files into their project, they can use the Accelerometer Simulator to provide accelerometer data to their application when debugging on the iPhone simulator…
Nothing special about the simulator, mind you, this code could also be applied to sending realtime data from an iPhone app to any other desktop app. Which has some intriguing possibilities. In the meantime, grab the project from Google Code, and using it really couldn’t be any simpler:
To embed Accelerometer Simulator capabilities into your own application, simply add the AccelerometerSimulation.h and AccelerometerSimulation.m files from the Simulator classes directory into your project. Then in the source file where you configure UIAccelerometer, simply add
#import “AccelerometerSimulation.h”
This will override the default behaviour of UIAccelerometer when run on the iPhone simulator. When building for device, nothing is changed in your application.
And note also this extension which lets you use your MacBook’s accelerometer to provide the data. Not that we can really think of an actual compelling use case for that … but hey, it’s a nifty hack, and who doesn’t love nifty hacks?
h/t: If ( … ) then { … }!
Colophon:
And it’s day 4 of The Great Wordpress Client Test, and today we’re using:
MarsEdit 2.3.2!
Now this is a right switchup from yesterday, when we ran screaming from MacJournal because it doesn’t have a HTML editing view; today we’re tossing MarsEdit out of serious contention because it doesn’t have a WYSIWIG view. Yes, the live preview is excellent, and yes the immediate image uploading is well done, and there’s lots of other good things about it … but although we want optional control over all our HTML, we’re not interested in mandatory control, that’s just too much effort. So we’ll give MarsEdit a 6/10 for being a very nice tool indeed if you do want complete control, but being unduly complicated for semi-casual blogging like ours. Yes, we’re hard to please, we know. Just call us Goldilocks.

Hi Alex – thanks for giving MarsEdit a spin. The lack of a “WYSIWYG” editor is something I acknowledge is a deal-breaker for many potential users. Needless to say, it’s high on my list of features to add to the app
Nice of you to stop by Daniel! It’s not WYSIWIG exactly … what the perfect tool will do is let me paste/drag and drop formatted text from a web page, or a PDF, or source directly from Xcode would be *really* cool; and create sensible HTML that I don’t need to bother looking at myself unless I really care to make it look different which I generally don’t as long as it’s reasonably readable. So “rich import from the pasteboard” is the real killer feature I’m looking for, I suppose.
Thanks for clarifying. I will keep this kind of workflow in mind as I continue to enhance the app. It probably would be easier to provide that kind of behavior though in the context of a “WYSIWYG” editor.