MacBook Pro: Development Platform Update

My new MBP finally arrived yesterday evening, so here are some of the usual 'brand new' pictures of it =) This is my new development platform, moving from MacBook Air, and I'm very excited about the OpenCL and graphics possibilities it will open me to in Snow Leopard development. More pics on Flickr, click any of the images to jump. -S

Using Dynamic Library Injection with the iPhone Simulator

UPDATE: This method no longer works for iPhone OS SDK 2.2 - please see my new article for an updated method. Many developers who are not targeting the App Store are developing extensions or plugins to SpringBoard, the iPhone's shell, using a piece of software called MobileSubstrate which simplifies the loading of your own code into SpringBoard. But, for development and debugging purposes, this takes valuable time as each time you build your plugin you have to delete the old version from the phone, sign your plugin, push the new version to the phone, and restart SpringBoard. All these steps take a little time off your life, but if you have access to the iPhone Simulator included with the SDK things are a bit easier! You can set up automatic loading of your dynamic library by replacing the SpringBoard binary with a shell script and passing the DYLD_INSERT_LIBRARIES option to the original SpringBoard with the path to your library, or if you want a quick once-off test, you can use gdb as below: • Run the iPhone Simulator • Get the PID of the running SpringBoard • Use gdb to attach to said PID • Use the following gdb commands to load your code
     call (int)dlopen("/path/to/MyPlugin.dylib", 2)
     continue
Your code should now inject itself into SpringBoard on the iPhone Simulator so you can test on the desktop, take screenshots, check for leaks, or merely stress test your application against the different builds of the iPhone OS (the Simulator allows version switching on the fly). For me, I find this very useful (I use the DYLD_INSERT_LIBRARIES method) so that I can iterate very quickly when developing Stack. You can also get the console output from SpringBoard by launching the iPhone Simulator from Terminal, so for debugging it's very important. Hope this post may be of some use. -S

Puzzllotto Non-US Version?

An interesting rumor floated its way to me today regarding Puzzllotto…

I'm told United Lemur are gearing up a version of Puzzllotto for sale outside the US in the next few days, which won't have the monetary prize because of legal reasons. Similarly, the name will be "Lemur Puzzle" (no lotto this time!).

I can't of course verify all this, but if it's true then the race is on! Will the U.S. be the first to complete the game? Or does the rest of the world have a fighting chance, even with America's head-start?

I think it will be very interesting to see what happens…

=)

Android 1.0 Source Release + Notes

Just pulled and compiled the Android 1.0 source and have it running in the emulator; took just over an hour to compile here for the entire system (minus WebKit - see below), and I can't imagine any OS compiling that fast =) WebKit is as of now timing out when you go and try to download the source. If you really want to compile Android without WebKit, here's how (you should have already followed the steps on the project site to set up the code):
• "repo sync" until it complains about not being able to download WebKit
• Edit your _androiddir_/.repo/manifest.xml and find the 'webkit' part. Remove from to for WebKit, and save.
• "repo sync" (everything should download)
• Run 'make' when all the code is unpacked. This will compile everything and make the disk images to run in the emulator from the Android 1.0 SDK.
• IMPORTANT: Run your EXISTING 1.0 SDK (the one downloaded from the project site), and use adb to pull out /system/lib/libwebcore.so (adb pull /system/lib/libwebcore.so ~/libwebcore.so)
• Copy your _androiddir_/out/target/product/generic/*.img to the location of the Android SDK disk images (_sdkdir_/tools/lib/images) - backup the SDK images first!
• IMPORTANT: Run the SDK emulator now and it should auto-load your compiled disk images. Now use "adb remount"  then "adb push ~/libwebcore.so /system/lib/libwebcore.so"
• Your compiled Android 1.0 should now boot to the desktop
(You will need to perform the remount & push every time you run the emulator, for reference)

TextGuru 1.1 Preview

I'm going to be all naughty here and show off some of the awesome improvements in TextGuru 1.1 (which has yet to be announced). • Proper file/folder management • Quick file sharing • A full FTP client • Web file downloading TextGuru is a truly powerful app, and expect to see more cool features soon! Keep an eye on http://brancipater.com/.

Future?

Well as of now I have a lot of projects going on! I am readying Speed 2.0 for the App Store, finishing Lights Off, coding up Stack 2.0.1, designing something special for TextGuru, and have submitted two more applications to the App Store! There's hardly time to breathe with all this, but even so I'm taking on new projects - something top secret right now, so can't talk about it =) Also, need to schedule some proper time with Zodttd to finally finish Doom and release it (Cydia). I'll have more info in the coming weeks as things slot into place, but until then, if you want to help out you can buy Speed on the App Store for a mere 99c! Thanks to everyone putting up with me -S

Speed v2.0

Speed v2.0 is coming to the App Store for $1.99 and will be much improved, with a top-secret new UI and awesome features. If you liked the original, you'll be blown away by 2.0. As a special promotion, I'm offering the current version of Speed for 99¢ to assist funding the future versions, but if you buy now for 99¢ then you'll receive all future versions at no extra charge! All existing users need not apply =) Also I'm making sure Speed is more accurate than ever, and the screenshot below (not showing the top secret UI) is there to prove it; all units will offer at least one place of decimals, and there's an average speed function too.

United Lemur and Puzzllotto

Mike Lee launched United Lemur today with a special event and live webcast; there are many awesome facets to this company so please check out the site at http://www.unitedlemur.org. Their first application for iPhone is a lickably gorgeous game called Puzzllotto: "The ancients spoke of an eighth continent—a dark, forbidding place, with forests so thick the eye strains to see other than green. The night air was filled with the anguished cries of the damned, while large, amber-hued eyes stared menacingly from the inscrutable canopy. Morning broke on sleepless night, revealing a hastily scattered camp site. As the shore receded over the horizon, the relief of narrow escape gave way to gnawing curiosity. What mysteries, what treasure, were the ghosts guarding so jealously? Puzzllotto transports you to this enigmatic world, inviting exploration and discovery, in the spirit of great puzzle games like Zork and Myst. Greet a friendly lemur while pondering the graceful, fluttering arcs of giant butterflies, but beware the wily Fosa! Make your way through the jungle, beautifully rendered by artist David Lanham (Iconfactory). Immerse yourself in the multilayered soundscape, recorded on location in Madagascar by Dr. Douglas Quin (Spore). Only when you are one with the island will it reveal its secrets." It looks great, so I suggest you check out http://www.puzzllotto.com/.

Stack v2.0.1 Positioning

Some power users have requested the ability to position the Stack as they like, and in 2.0.1 I intend to give you that option. As it stands, I haven't decided whether it will be a GUI-configurable option, but I will certainly allow the positioning to be edited in the Stack preferences file (/User/Library/Preferences/com.steventroughtonsmith.stack.plist). Hope this will please those whom were asking!

HowTo: Reset your Stack Icons to Default

Have had a few e-mails from people saying they have icons in their Stack that they cannot remove; fear not o loyal users! You can easily reset the Stack entries list to the default by deleting the file at: /User/Library/Preferences/com.steventroughtonsmith.stack.entries.plist This can be useful if you've ended up with some empty, blank white icons in Stack. -S

Stack v2.0.1 Display Style Preference

Yes people, I do listen =)

Rendering into a UIImage

Ok, since this is a very useful piece of code for myself, I'm going to share it with you all. In Cocoa on the desktop, you can draw whatever you like into an NSImage very easily:
[myImage lockFocus]; // draw [myImage unlockFocus];
However, coming to Cocoa Touch on iPhone, without searching around a bit you won't find a way to do this. Well, thanks to Sam Steele (of Last.fm infamy), here's a code snippet which will do the exact same thing for you! Yes it's all in the docs, but takes a bit of looking to find.
UIGraphicsBeginImageContext(CGMakeSize(64.0f, 64.0f)); /* Put any sort of drawing code here */ [anImage drawAtPoint:CGPointZero]; [aView drawRect:CGRectMake(0.0f, 0.0f, 64.0f, 64.0f)]; UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
Hopefully this will help some budding iPhone developers out there.

Stack v2.0.1 Initial Work

Have done some initial work on the next revision of Stack, so here's a shot to show you what's different. • It now supports dynamic icons (i.e. Calendar) • Smoothed out fan animation • Moved settings icon and improved hit detection

The NDA Rescinded: A Joyous Day

Can't say much more than this =)