1

I have a jailbroken iPod Touch 1.1.4, and want to experiment with creating minimalistic "apps" just by scripting, launching Safari to a "webapp". But 1.1.4 does not have the "Add to Home Screen" shortcut option. Is there a way to simulate this just by scripting? I've tried editing the HelloPython Bash script, changing it to:

#!/bin/bash
/Applications/MobileSafari.app/MobileSafari http://gnixl.com/

And I get the error:

ABORT: Unable to register "com.apple.mobilesafari" port, 1103 unknown error code.

I removed the URL http://gnixl.com/, same error.

Is there a way to do this without using Python or Objective-C? Not that I'm not willing to use either/or, but I'm looking for the most barebones approach that will do something first.

If someone with a newer iPod touch could "add to home screen" anything and analyze what it puts into the Applications folder, that might be just the info I need. Or if someone jailbroke their device with ziphone and left the link on the homescreen, that would work too unless the "link" is actually an executable.

[update 2016-01-25: 2 github projects now up using troutinator's answer as template: https://github.com/jcomeauictx/conwaylife and https://github.com/jcomeauictx/taillight]

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
  • I believe it's possible because ziphone left a link on the homescreen, which I foolishly deleted in a "housekeeping" frenzy. – jcomeau_ictx Feb 23 '11 at 20:57
  • What do you mean by creating minimalistic app? You want, by scripting, create an app similar to when you press the "Add to Home Screen" menu? – Guillaume Mar 02 '11 at 13:40
  • @Guillaume: the webapps I know how to make. what I don't know is how to make a home-screen shortcut to launch MobileSafari to my app. so yes, I want to find out how to do what "add to home screen" does, at the filesystem level. – jcomeau_ictx Mar 02 '11 at 14:58

1 Answers1

2

Okay, I have an iPhone 3G. I created an link from Safari using the "Add To Home Screen" button. It created a directory called 54C86B09482D4560BAB46091CC75825A.webclip inside of /private/var/mobile/Library/WebClips/. That directory contains two files, icon.pngand Info.plist. icon.png is simply the icon that gets shown when looking at the apps screen.

The contents of Info.plist are where the real information is:

<?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>ClassicMode</key>
        <false/>
        <key>FullScreen</key>
        <false/>
        <key>IconIsPrecomposed</key>
        <false/>
        <key>IconIsScreenShotBased</key>
        <true/>
        <key>Scale</key>
        <real>0.32653060555458069</real>
        <key>ScrollPoint</key>
        <dict>
                <key>x</key>
                <real>0.0</real>
                <key>y</key>
                <real>-183</real>
        </dict>
        <key>Title</key>
        <string>The Daily WTF</string>
        <key>UIStatusBarStyle</key>
        <string>UIStatusBarStyleGray</string>
        <key>URL</key>
        <string>http://thedailywtf.com/</string>
</dict>
</plist>

Edit: Fixed some grammar, clarified things a bit, and added the test/example below:

So, to test this out I created a new folder called C28C8FDC2F184AAD84F77B511442548F.webclip and copied the Info.plist file over from the other directory, edited the url to http://google.com. I then re-sprung the phone and it showed up just like any other webclip. The folder name is simply a hex encoded GUID, I used http://www.somacon.com/p113.php and just selected what was after 0x for this simple test

troutinator
  • 1,160
  • 1
  • 7
  • 22
  • thank you! awesome, just what I needed! it crashes my MobileSafari, but otherwise it works. maybe because I didn't use a GUID, just "test.webclip". but it shows up on my desktop just fine. much appreciated! – jcomeau_ictx Mar 03 '11 at 04:34
  • thought that accepting it would give you the bounty, but then I noticed it didn't... looks like you got it now! thanks again. – jcomeau_ictx Mar 03 '11 at 04:48
  • by editing the Info.plist, I've gotten to where I have something that doesn't crash MobileSafari. – jcomeau_ictx Mar 03 '11 at 06:20
  • Glad to help out, and glad that its working without crashing for you. – troutinator Mar 03 '11 at 15:17