views:

204

answers:

1

I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like MobileTerminal since there is no way to get output, but it has its uses.

It works great for simple scripts, but long scripts get timed out with a "failed to launch in time" error in syslog. Searching led me here where there are discussions about the timeout for launching legitimate iPhone apps.

I assume a script can't communicate to the system that it launched cleanly, but is there any way to get around that timeout with a script?

I'm a Linux guy and don't have a Mac or Windows for XCode or enough free time to learn C++, I'd just be happy if all my scripts worked, not just the short ones.

A: 

I think you might have more luck asking on a discussion forum for jail-broken iPhones. At a guess, Springboard is killing your "apps" because they're not starting an event-processing loop. As far as I know, there's no way to do that from a shell script.

Perhaps someone has made a Cocoa Touch app that'll execute your scripts for you, while keeping Springboard happy.

Mark Bessey
Thanks. From what I have read, your guess sounds correct. NSApplication manages the event loop and the app is supposed to call applicationDidFinishLaunching as part of that. If a script runs for a while without making the call, the system assumes it is hung and kills it.I'll keep looking but unfortunately the "hackerish" jail-broken forums are dead and the rest are filled with questions on jail-breaking or themes.
JM