Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems
Code and Hacks

Turning the Iphone 3G into an almost useful always-on IM device

Posted by Admin • Saturday, March 14. 2009 • Category: Code and Hacks

I've had a Blackberry for quite some time now, and came to take for granted the basic ability to be always available via Google Talk, Latitude, email, etc - not to mention have fine-grained control of when I get notified about each one. Running multiple apps (gtalk, maps, ssh, browsers, etc) - was never a problem, and there is even an Alt-Tab equivalent for toggling between running apps. Blackberry even has an integrated push-IM system for Blackberry to Blackberry communication.

All that changed with the IPhone (if it was not paid for, I would never have gotten one, but now I'm trying to make the most of it while saving the money I used to spend on the Blackberry). The IPhone (3G, 2.2.1) proved to be unable to do any of the above well. No mail alerting rules, no running multiple applications !!?? Basically this is an always-on device that cannot provide most always-on services. So this is my quest to make the device useful.

Yes naturally I realize that there are downsides to both devices, and I gladly give credit to the IPhone UI, but personally I'd rather deal with a command-line UI if I had to choose between functionality and having a fancy but incapable toy.


Basically everything you would need to do to change the Iphone's default behavior involves Jailbreaking the device. There are numerous tutorials available, but for my 2.2.1 IPhone it boils down to:

  1. Install ITunes (Windows)
  2. Get QuickPwn
  3. Get 2.2.1 Firmware (same page)
  4. Run it, tell it where you downloaded the firmware to, do what it tells you, you're done

Now that it's out of jail, you should have Cydia and Installer. The former is an APT-based package manager, for those familiar with Ubuntu and Debian in general. It is backed by a pretty lofty repo of iphone apps, and the first thing you'll want to do is run Cydia and upgrade... Cydia. Until you do it will probably act funny. (It should prompt you if there is an update for it).

And that brings us to installing apps.

Additional Apps

The following apps are highly useful in messing around with all this (And are installable through Cydia, use the search tab):

  1. MobileTerminal (not strictly necessary if you can SSH into your IPhone from your PC)
  2. openssh (this is client and server)
  3. ericasadun (Erica's Utils - various command-line tools for messing with iphone innards)
  4. backgrounder (Allows applications to be backgrounded - that's what we actually want here)
  5. insomnia (Icon driven hack that keeps the iphone from sleeping. Sleeping is bad - it kills running apps)

Putting it Together

  1. Once you have backgrounder installed you can test it out by running your IM client of choice (I did this with IM+), holding home down until it says "bla bla backgrounded". Now if you return to IM+, it will still be logged in. That's victory number one
  2. The IM app will still die if the device goes to sleep, or is locked, and especially if you use password lock. (I had to disable password lock, not sure if there is a way around that)
  3. Run insomnia, and its icon will show "ON". Now you should be able to hit the power button, and IM should still work. (Some Insomnia Docs)
  4. There are other tweaks you can try if you're having trouble: Winterboard has "Extended Preferences" which unlocks a pref in Settings that allows you to dim screen but not lock. It's a desperate hack because the screen doesn't dim all that much
  5. Unfortunately, none of this helps you when IM+ (or another client) decides to lose connection, and then just sits there with the error message
  6. Unfortunately insomnia seems to somehow get turned off too

Configuring Backgrounder to leave IM+ always on:

Backgrounder is great, but every time your IPhone kills the IM client for any reason, you have to remember to background it again. Let's change that:

  1. Make sure you installed Erica's s Utils (Cydia, search for 'ericasadun'). That gives you the plutil utility
  2. SSH into your phone (You'll want to be on Wi-Fi for that). (or if you are patient, you can do this in mobile terminal. You did install mobileterminal from Cydia, right?). SSH Log in is root:alpine (openssh iphone docs)
  3. cd /var/mobile/Library/Preferences
  4. Backup your prefs file: cp jp.ashikase.backgrounder.plist jp.ashikase.backgrounder.plist.bak
  5. Convert it to xml: plutil -c xml1 jp.ashikase.backgrounder.plist
  6. Edit with nano and make it look like this: (Reference Docs are here)
  7. The above is for IM+. To determine the name for another app you want to always background, use sb -l - it's in there somewhere ...
  8. Save (ctrl-x)... If you are in mobile terminal, to type CTRL-anything you'll have to click
    .?123, then #+=, then rightmost dot, then ABC, and finally the letter you want.
    Yes... Fun. Some help on using Mobile Terminal
  9. Convert it back to binary: plutil -c binary1 jp.ashikase.backgrounder.plist
  10. You probably need to reboot at this point for it to take effect


Until there is real IM push, this is going to remain a big ugly hack with questionable stability. Good luck.

0 Trackbacks

  1. No Trackbacks


Display comments as (Linear | Threaded)
  1. hi,

    excellent info. exactly the post i was looking for. i thought backgrounder was enough to keep the apps running.

    The insomnia app was the one i didnt know about. 99% of the people are having this trouble but none have the solution. all the forums are filled with IM's logging out even if backgrounder is running and most are thinking its some trouble with the IM client.

    thanks a ton for this trick.

  2. I'm considering this whole topic closed at this point for several reasons:

    1) I no longer have an IPhone - I've given up, it just can't do certain things without hours and hours of hackery and then it becomes unstable.

    I've had 3 Blackberries over 4 years, and every one of them ran dozens of apps simultaneously without any complaints. To quote the devout Apple fans among my friends: "I hear they'll be fixing that in release 4.0" (Though the version number keeps changing every year)

    2) Theoretically IM push makes the above obsolete, unless you're trying to do something else that requires an app to stay running.

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Markdown format allowed

Submitted comments will be subject to moderation before being displayed.