Building an Apple watch (or how to repurpose an old iPhone)

No, not a Watch. Actually, not even a watch… more like a clock. 🙂

Built only with original Apple parts!
Built only with original Apple parts!

I had an old and unused iPhone 3GS lying around and I didn’t feel like throwing it away just yet. On the other hand, I did need a nice looking clock to place near my TV set, so why not use the iPhone?

Designed by Apple. Probably not with this use in mind.
Designed by Apple. Probably not with this use in mind.
The small black box that holds the iPhone manual is a perfect stand
The small black box that holds the iPhone manual is a perfect stand

The major issues were the following:

  • the iPhone battery is very old and it doesn’t last long when the display is always on (waaay less than 24 hours, pretty much like the other Watch! 🙂 )
  • I didn’t want to have to fiddle with the iPhone everytime I turned it on: it should just work! It’s not continuosly powered, so the battery will eventually drain. When it gets power again (i.e. I turn the TV on), it should start and display the time.

The first problem is easily solved: I can either leave the phone always plugged to its charger, or I can connect it to one of the USB ports of my TV set. I chose the latter option, to save a power outlet.

The second issue required jailbreaking the phone and performing some custom configuration. DISCLAIMER: if you attempt to do something like this, it’s at your own risk!

Using Cydia, I’ve installed OpenSSH and a bunch of command line utils (including vim and open) and SkipLock. To start the clock application automatically, I’ve created a simple script and saved it as /usr/bin/startup.sh:

# need to wait a bit so that everything else is ready
# (and the lock screen has been bypassed)
sleep 10

# the parameter is the bundle ID of the application you want to start
/usr/bin/open com.yoctoville.yoctoclock

…and I’ve added a launchd plist in /Library/LaunchDaemons/startup.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.tellini.wizphone.startup</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>/usr/bin/startup.sh</string>
    </array>
    <key>UserName</key>
    <string>mobile</string>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Then, I’ve disabled many apps and processes that are not useful in my case, just to try and squeeze more time out of the battery. What I did was renaming the following apps in /Applications/:

AdSheet.app.disabled/     MobilePhone.app.disabled/  Music~iphone.app.disabled/
MobileMail.app.disabled/  MobileSMS.app.disabled/

and the following services in /System/Library/LaunchDaemons/:

com.apple.apsd.plist.disabled          com.apple.datamigrator.plist.disabled
com.apple.gamed.plist.disabled         com.apple.iapd.plist.disabled
com.apple.mediaserverd.plist.disabled  com.apple.searchd.plist.disabled

Appending .disabled (or anything else) to their name is enough to prevent the system from loading them.

Leave a Reply

Your email address will not be published. Required fields are marked *