Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

strife07

macrumors newbie
Original poster
Jul 21, 2009
5
0
Hi,

I need some advice.
I'm working with a jailbroken iPhone 3G on OS 3.0.
I have an app that launches MobileSafari and does some other checks after that.
Since there is no background support for iPhone, my app is supposed to close after opening MobileSafari, but I kind of cheated by adding a loop in my codes after launching MobileSafari.
I found that the app will attempt to run the remaining codes before it closes. This way, I can get my app to continue running even after it launches MobileSafari.

But here's the catch.
While my iPhone is tethered to my Mac, my app runs well when I build and go in Xcode.
But it fails and crashed when I run the app independently.
I checked the crash reports and the exception code is 0x8badf00d.
Other than that it also says that my app failed to suspend in time.

I went to google around a little and I think the watchdog process expects my app to close itself within 5 seconds after launching MobileSafari.
It's working from Xcode because the watchdog timer is disabled while running from Xcode.

So I was thinking of a few options:
1. Is there any way to run my app in the background after launching MobileSafari for the first time?
I tried out Backgrounder, but it's not really working well with my app.
It still crashes after the 5 second time limit.
I've gone through the documentations at Google Code, but I can't seem to find any instructions on how to add proper background support.

2. Is there some way to disable the watchdog timer?
I know this will probably be quite problematic since the iPhone has both a watchdog process watching Springboard and a hardware watchdog.
If I'm not wrong, the watchdog process kills and forcibly restarts Springboard if it doesn't respond every 2 minutes. Other than that, the watchdog process communicates with the hardware watchdog and periodically resets it. If this doesn't happen, the iPhone will reboot after 10 minutes.

3. Is it possible to launch MobileSafari from the commandline?
I know Erica Sadun's EricaUtilities has support for launching apps and URLs from the commandline. But it seems to be broken after the upgrade to 3.0. If I could get this to work, I might be able to do a simple shell script instead of using the app.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.